public void Consume(SimpleRequest message) { var response = new SimpleResponse { Message = "Response created on thread: " + Thread.CurrentThread.ManagedThreadId, }; message.Reply(response); }
private void Consume(SimpleResponse response) { Interlocked.Increment(ref _responseCount); _body.AppendLine("Response created at: " + response.Created); _body.AppendLine(response.Message); _body.AppendLine("Callback executed on thread: " + Thread.CurrentThread.ManagedThreadId); _body.AppendLine("Request Count: " + _requestCount + " Response Count: " + _responseCount); _context.Response.ContentType = "text/plain"; _context.Response.Write(_body.ToString()); _asyncResult.SetAsCompleted(); }