-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelk.rb
45 lines (36 loc) · 845 Bytes
/
elk.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require 'active_support'
require 'active_support/core_ext/numeric'
require 'cassandra'
require 'celluloid/current'
require 'connection_pool'
require 'faker'
require 'redis'
# Elk
module Elk
class ActorBase
PAGE_VIEW = 'page_view'.freeze
LAST_VISIT = 'last_visit'.freeze
VISITOR = 'visitor'.freeze
VISITOR_LOCK = 'visitor_lock'.freeze
# t1_pool redis
# t2_pool cassandra
attr_reader :t1_pool
attr_reader :t2_pool
def initialize(t1_pool, t2_pool)
@t1_pool = t1_pool
@t2_pool = t2_pool
end
def t1_exec(&blk)
@t1_pool.with(&blk)
end
def t2_exec(&blk)
@t2_pool.with(&blk)
end
end
end
require_relative './actors/butler'
require_relative './actors/collector'
# module Elk
# class ButlerSupervisor < Celluloid::Supervision::Container
# end
# end