Class: EventMachine::Bucketer::InMemory
- Inherits:
-
Object
- Object
- EventMachine::Bucketer::InMemory
- Includes:
- Database::Hash, Base
- Defined in:
- lib/em-bucketer/in_memory.rb
Constant Summary collapse
- BUCKET_THRESHOLD_SIZE_DEFAULT =
1000
- BUCKET_MAX_AGE_DEFAULT =
3600
Instance Method Summary collapse
-
#initialize(bucket_threshold_size: BUCKET_THRESHOLD_SIZE_DEFAULT, bucket_max_age: BUCKET_MAX_AGE_DEFAULT) ⇒ InMemory
constructor
Creates a new in memory Bucketer with the requested configurations.
Methods included from Base
#add_item, #empty_bucket, #get_and_empty_bucket, #get_and_remove, #get_bucket, #on_bucket_full, #on_bucket_timeout, #setup
Constructor Details
#initialize(bucket_threshold_size: BUCKET_THRESHOLD_SIZE_DEFAULT, bucket_max_age: BUCKET_MAX_AGE_DEFAULT) ⇒ InMemory
Creates a new in memory Bucketer with the requested configurations
after which the on_bucket_full callback is called can remain before the on_bucket_timed_out is called
20 21 22 23 |
# File 'lib/em-bucketer/in_memory.rb', line 20 def initialize(bucket_threshold_size: BUCKET_THRESHOLD_SIZE_DEFAULT, bucket_max_age: BUCKET_MAX_AGE_DEFAULT) setup(bucket_threshold_size, bucket_max_age) setup_db end |