Skip to content

Commit eddaea4

Browse files
committed
Add "Async" suffix to async methods
1 parent f286391 commit eddaea4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/ModelContextProtocol.AspNetCore/StreamableHttpHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ await WriteJsonRpcErrorAsync(context,
6060
}
6161

6262
InitializeSseResponse(context);
63-
var wroteResponse = await session.Transport.HandlePostRequest(message, context.Response.Body, context.RequestAborted);
63+
var wroteResponse = await session.Transport.HandlePostRequestAsync(message, context.Response.Body, context.RequestAborted);
6464
if (!wroteResponse)
6565
{
6666
// We wound up writing nothing, so there should be no Content-Type response header.
@@ -101,7 +101,7 @@ await WriteJsonRpcErrorAsync(context,
101101
// will be sent in response to a different POST request. It might be a while before we send a message
102102
// over this response body.
103103
await context.Response.Body.FlushAsync(context.RequestAborted);
104-
await session.Transport.HandleGetRequest(context.Response.Body, context.RequestAborted);
104+
await session.Transport.HandleGetRequestAsync(context.Response.Body, context.RequestAborted);
105105
}
106106

107107
public async Task HandleDeleteRequestAsync(HttpContext context)

src/ModelContextProtocol.Core/Protocol/JsonRpcMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private protected JsonRpcMessage()
4040
/// <remarks>
4141
/// This property should only be set when implementing a custom <see cref="ITransport"/>
4242
/// that needs to pass additional per-message context or to pass a <see cref="JsonRpcMessageContext.User"/>
43-
/// to <see cref="StreamableHttpServerTransport.HandlePostRequest(JsonRpcMessage, Stream, CancellationToken)"/>
43+
/// to <see cref="StreamableHttpServerTransport.HandlePostRequestAsync(JsonRpcMessage, Stream, CancellationToken)"/>
4444
/// or <see cref="SseResponseStreamTransport.OnMessageReceivedAsync(JsonRpcMessage, CancellationToken)"/> .
4545
/// </remarks>
4646
[JsonIgnore]

src/ModelContextProtocol.Core/Server/StreamableHttpServerTransport.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ public sealed class StreamableHttpServerTransport : ITransport
4343
/// <summary>
4444
/// Configures whether the transport should be in stateless mode that does not require all requests for a given session
4545
/// to arrive to the same ASP.NET Core application process. Unsolicited server-to-client messages are not supported in this mode,
46-
/// so calling <see cref="HandleGetRequest(Stream, CancellationToken)"/> results in an <see cref="InvalidOperationException"/>.
46+
/// so calling <see cref="HandleGetRequestAsync(Stream, CancellationToken)"/> results in an <see cref="InvalidOperationException"/>.
4747
/// Server-to-client requests are also unsupported, because the responses may arrive at another ASP.NET Core application process.
4848
/// Client sampling and roots capabilities are also disabled in stateless mode, because the server cannot make requests.
4949
/// </summary>
5050
public bool Stateless { get; init; }
5151

5252
/// <summary>
53-
/// Gets a value indicating whether the execution context should flow from the calls to <see cref="HandlePostRequest(JsonRpcMessage, Stream, CancellationToken)"/>
53+
/// Gets a value indicating whether the execution context should flow from the calls to <see cref="HandlePostRequestAsync(JsonRpcMessage, Stream, CancellationToken)"/>
5454
/// to the corresponding <see cref="JsonRpcMessageContext.ExecutionContext"/> property contained in the <see cref="JsonRpcMessage"/> instances returned by the <see cref="MessageReader"/>.
5555
/// </summary>
5656
/// <remarks>
@@ -76,7 +76,7 @@ public sealed class StreamableHttpServerTransport : ITransport
7676
/// <param name="sseResponseStream">The response stream to write MCP JSON-RPC messages as SSE events to.</param>
7777
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
7878
/// <returns>A task representing the send loop that writes JSON-RPC messages to the SSE response stream.</returns>
79-
public async Task HandleGetRequest(Stream sseResponseStream, CancellationToken cancellationToken = default)
79+
public async Task HandleGetRequestAsync(Stream sseResponseStream, CancellationToken cancellationToken = default)
8080
{
8181
Throw.IfNull(sseResponseStream);
8282

@@ -111,7 +111,7 @@ public async Task HandleGetRequest(Stream sseResponseStream, CancellationToken c
111111
/// If 's an authenticated <see cref="ClaimsPrincipal"/> sent the message, that can be included in the <see cref="JsonRpcMessage.Context"/>.
112112
/// No other part of the context should be set.
113113
/// </para>
114-
public async Task<bool> HandlePostRequest(JsonRpcMessage message, Stream responseStream, CancellationToken cancellationToken = default)
114+
public async Task<bool> HandlePostRequestAsync(JsonRpcMessage message, Stream responseStream, CancellationToken cancellationToken = default)
115115
{
116116
Throw.IfNull(message);
117117
Throw.IfNull(responseStream);

0 commit comments

Comments
 (0)