コード例 #1
0
 public RemoteRequestListener2(IZmqContext context, string endpoint, int workers,
                               LocalInvocationDispatcher dispatcher,
                               SerializationStrategy serializationStrategy)
 {
     _endpoint              = endpoint;
     _dispatcher            = dispatcher;
     _serializationStrategy = serializationStrategy;
     _reply = context.Rep();
 }
コード例 #2
0
 public void Init()
 {
     _service    = new StubService();
     _dispatcher = new LocalInvocationDispatcher(service =>
     {
         if (service == serviceName)
         {
             return(Tuple.Create <object, Type>(_service, _service.GetType()));
         }
         throw new Exception("service not found");
     }, new ProtoBufSerializationStrategy());
 }
コード例 #3
0
        public RemoteRequestListener(IZmqContext context, string endpoint, int workers,
                                     LocalInvocationDispatcher dispatcher,
                                     SerializationStrategy serializationStrategy)
        {
            this._context               = context;
            this._endpoint              = endpoint;
            this._workers               = workers;
            this._dispatcher            = dispatcher;
            this._serializationStrategy = serializationStrategy;

            var count = Interlocked.Increment(ref localAddUseCounter);

            this._localEndpoint = "inproc://rrworker_" + count;
        }