コード例 #1
0
ファイル: RequestService.cs プロジェクト: KevM/Magnum
        public void Consume(SimpleRequest message)
        {
            var response = new SimpleResponse
                {
                    Message = "Response created on thread: " + Thread.CurrentThread.ManagedThreadId,
                };

            message.Reply(response);
        }
コード例 #2
0
ファイル: SimpleRequestActor.cs プロジェクト: KevM/Magnum
        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();
        }