Example #1
0
            public SetPrefetchCountConsumer(IConsumePipeConnector managementPipe, ModelContext modelContext, ISetPrefetchCount filter)
            {
                _modelContext = modelContext;
                _filter       = filter;

                _handle = managementPipe.ConnectInstance(this);
            }
Example #2
0
        async Task <IMessageClient> CreateMessageClient <T>(Type messageType, CancellationToken cancellationToken)
            where T : class
        {
            var messageClient = new MessageClient <T>(this);

            var handle = _consumePipeConnector.ConnectInstance(messageClient);

            try
            {
                if (_log.IsDebugEnabled)
                {
                    _log.DebugFormat("Requesting Link to {0} (client-id: {1})", TypeMetadataCache <T> .ShortName, ClientId);
                }

                var request = _clientFactory.CreateRequestClient <Link <T> >().Create(new { ClientId }, cancellationToken);

                var response = await request.GetResponse <Up <T> >().ConfigureAwait(false);

                return(messageClient);
            }
            catch (Exception)
            {
                handle.Disconnect();
                throw;
            }
        }
Example #3
0
 public ConnectHandle Connect(IConsumePipeConnector bus)
 {
     return(bus.ConnectInstance(_consumer));
 }