module MongoAutoIncrement
Constants
- VERSION
Attributes
cache_store[RW]
ActiveSupport::Cache::Store default: ActiveSupport::Cache.lookup_store(:memory_store)
MongoAutoIncrement.cache_store
= ActiveSupport::Cache.lookup_store(:memcache_store, “127.0.0.1”) For cache ids
seq_cache_size[RW]
How many ids generate in once call, and it will cache ids in Memroy, to reduce MongoDB write default: 1
- Call first
-
-> [occupancy N and Write MongoDB] -> [Save N ids in Memory variable `aii_cache`]
- Next call
-
-> [Shift aii_cache and return]
.….
- N+1 call
-
-> [occupancy N and Write MongoDB] -> [Save N ids in Memory variable `aii_cache`]
Public Class Methods
cache_enabled?()
click to toggle source
# File lib/mongo_auto_increment/config.rb, line 22 def cache_enabled? self.seq_cache_size > 1 end