Example #1
0
        public HttpTransport(string name, CancellationToken cancellationToken)
        {
            _cancellationToken = cancellationToken;

            _bus    = new HttpTransportBus(name);
            _sender = new HttpTransportSender(name, _bus, cancellationToken);
        }
 public HttpTransportSender(string name, TimeSpan shortOperationsTimeout, HttpTransportBus bus, CancellationToken cancellationToken)
 {
     _bus = bus;
     _cancellationToken = cancellationToken;
     _log = LogManager.GetLogger(GetType().Name + "." + name);
     _shortOperationsTimeout = shortOperationsTimeout;
 }
Example #3
0
        public HttpTransport(string name, TimeSpan shortOperationsTimeout, CancellationToken parentToken)
        {
            _linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(parentToken);

            _bus    = new HttpTransportBus(name);
            _sender = new HttpTransportSender(name, shortOperationsTimeout, _bus, _linkedTokenSource.Token);
        }
Example #4
0
		public override async Task<HttpResponseMessage> ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)
		{
			_bus = (HttpTransportBus) controllerContext.Configuration.Properties[typeof (HttpTransportBus)];
			var sp = Stopwatch.StartNew();
			var msg = await base.ExecuteAsync(controllerContext, cancellationToken);
			if (_bus.Log.IsDebugEnabled)
			{
				_bus.Log.Debug("{0} {1} {2} in {3:#,#;;0} ms", msg.StatusCode, controllerContext.Request.Method, controllerContext.Request.RequestUri, 
					sp.ElapsedMilliseconds);
			}
			return msg;
		}
Example #5
0
        public override async Task <HttpResponseMessage> ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)
        {
            _bus = (HttpTransportBus)controllerContext.Configuration.Properties[typeof(HttpTransportBus)];
            var sp  = Stopwatch.StartNew();
            var msg = await base.ExecuteAsync(controllerContext, cancellationToken);

            if (_bus.Log.IsDebugEnabled)
            {
                _bus.Log.Debug("{0} {1} {2} in {3:#,#;;0} ms", msg.StatusCode, controllerContext.Request.Method, controllerContext.Request.RequestUri,
                               sp.ElapsedMilliseconds);
            }
            return(msg);
        }
Example #6
0
 public HttpTransportSender(string name, HttpTransportBus bus)
 {
     _bus = bus;
     _log = LogManager.GetLogger(GetType().Name + "." + name);
 }
Example #7
0
 public HttpTransportSender(string name, HttpTransportBus bus, CancellationToken cancellationToken)
 {
     _bus = bus;
     _cancellationToken = cancellationToken;
     _log = LogManager.GetLogger(GetType().Name + "." + name);
 }
Example #8
0
 public HttpTransport(string name)
 {
     _bus    = new HttpTransportBus(name);
     _sender = new HttpTransportSender(name, _bus);
 }
Example #9
0
			public HttpTransportMessageContext(TaskCompletionSource<HttpResponseMessage> tcs, HttpTransportBus parent)
			{
				_tcs = tcs;
				sent = tcs == null;
				_parent = parent;
			}
Example #10
0
		public HttpTransport(string name)
		{
			_bus = new HttpTransportBus(name);
			_sender = new HttpTransportSender(name,_bus);
		}
Example #11
0
 public HttpTransportMessageContext(TaskCompletionSource <HttpResponseMessage> tcs, HttpTransportBus parent)
 {
     _tcs    = tcs;
     sent    = tcs == null;
     _parent = parent;
 }
Example #12
0
		public HttpTransportSender(string name, HttpTransportBus bus)
		{
			_bus = bus;
			_log = LogManager.GetLogger(GetType().Name + "." + name);
		}