/// <summary>
        ///     <para>Initializes the store.</para>
        /// </summary>
        /// <param name="config">
        ///     <para>An object containing the configuration of the store.</para>
        /// </param>
        public void Initialize(object config)
        {
            ClearState();
            var specConfig = (SerializingObjectStorageConfig)config;

            Storage      = specConfig.Storage;
            _allowsDrops = (Storage.OutOfSpacePolicy == OutOfSpacePolicy.DropEntries);
            if (_allowsDrops)
            {
                _keyspaceInfos    = new Dictionary <DataBuffer, KeyspaceInfo>();
                _keyspaceInfoLock = new MsReaderWriterLock(System.Threading.LockRecursionPolicy.SupportsRecursion);
                Storage.Dropped  += Storage_Dropped;
            }
            else
            {
                Storage.Dropped  -= Storage_Dropped;
                _keyspaceInfos    = null;
                _keyspaceInfoLock = null;
            }
            StreamPool = specConfig.StreamPool;
        }
 public MatchMaker(int maxPoolItemReuse)
 {
     replies   = new Dictionary <short, ReplyBucket>(32);
     idPool    = new ResourcePool <short>(new ResourcePool <short> .BuildItemDelegate(GetNextMessageId), maxPoolItemReuse);
     replyLock = new MsReaderWriterLock(System.Threading.LockRecursionPolicy.NoRecursion);
 }
示例#3
0
 public MatchMaker(int maxPoolItemReuse)
 {
     replies = new Dictionary<short, ReplyBucket>(32);
     idPool = new ResourcePool<short>(new ResourcePool<short>.BuildItemDelegate(GetNextMessageId), maxPoolItemReuse);
     replyLock = new MsReaderWriterLock(System.Threading.LockRecursionPolicy.NoRecursion);		
 }