Esempio n. 1
0
 public static Func <ReplicatedObject, ObjectMessageSender> CreateFactory(
     IMessageSender sender,
     TransportGroupRouter groupRouter,
     TransportGroupId group,
     IBasicObjectPool <MulticastNetworkMessage> networkMessages)
 {
     return(@object => new ObjectMessageSender(sender, groupRouter, group, networkMessages, @object));
 }
Esempio n. 2
0
        public ObjectPool(Func <ManagedObject <T> > factory, int growthStep)
        {
            Action <PooledObject> returnToPool = pooledObject => _baseObjectPool.Return(pooledObject);

            _baseObjectPool = new BasicObjectPool <PooledObject>(
                pool => new PooledObject(returnToPool, @object: factory()),
                onReturnToPool: @object => @object.ManagedObject.OnReturnedToPool(),
                onTakenFromPool: @object => @object.ManagedObject.OnTakenFromPool(),
                growthStep: growthStep);
        }
Esempio n. 3
0
 public ObjectMessageSender(IMessageSender sender,
                            TransportGroupRouter groupRouter,
                            TransportGroupId group,
                            IBasicObjectPool <MulticastNetworkMessage> networkMessages,
                            ReplicatedObject o)
 {
     _sender          = sender;
     _object          = o;
     _groupRouter     = groupRouter;
     _group           = group;
     _networkMessages = networkMessages;
 }
Esempio n. 4
0
 public MulticastNetworkMessage(IBasicObjectPool <MulticastNetworkMessage> pool, MessageType toObjectIdMessageType)
 {
     _pool = pool;
     _toObjectIdMessageType = toObjectIdMessageType;
 }