Skip to content

Commit

Permalink
Update generated rpc requests to not omit ConfigureAwait(false) (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
robcao authored Jun 4, 2024
1 parent 83670a0 commit 43d0f86
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 164 deletions.
4 changes: 2 additions & 2 deletions src/Temporalio.Api.Generator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ static string GenerateServiceRPCSource(
code += "\n /// <param name=\"options\">Optional RPC options.</param>";
code += "\n /// <returns>RPC response</returns>";
code +=
$"\n public async Task<{resp}> {call}Async({req} req, RpcOptions? options = null)\n";
$"\n public Task<{resp}> {call}Async({req} req, RpcOptions? options = null)\n";
code += " {\n";
code +=
$" return await InvokeRpcAsync(\"{call}\", req, {resp}.Parser, options);\n";
$" return InvokeRpcAsync(\"{call}\", req, {resp}.Parser, options);\n";
code += " }\n";
}
code += " }\n}";
Expand Down
48 changes: 24 additions & 24 deletions src/Temporalio/Client/OperatorService.Rpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public abstract partial class OperatorService
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<AddOrUpdateRemoteClusterResponse> AddOrUpdateRemoteClusterAsync(AddOrUpdateRemoteClusterRequest req, RpcOptions? options = null)
public Task<AddOrUpdateRemoteClusterResponse> AddOrUpdateRemoteClusterAsync(AddOrUpdateRemoteClusterRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("AddOrUpdateRemoteCluster", req, AddOrUpdateRemoteClusterResponse.Parser, options);
return InvokeRpcAsync("AddOrUpdateRemoteCluster", req, AddOrUpdateRemoteClusterResponse.Parser, options);
}

/// <summary>
Expand All @@ -26,9 +26,9 @@ public async Task<AddOrUpdateRemoteClusterResponse> AddOrUpdateRemoteClusterAsyn
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<AddSearchAttributesResponse> AddSearchAttributesAsync(AddSearchAttributesRequest req, RpcOptions? options = null)
public Task<AddSearchAttributesResponse> AddSearchAttributesAsync(AddSearchAttributesRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("AddSearchAttributes", req, AddSearchAttributesResponse.Parser, options);
return InvokeRpcAsync("AddSearchAttributes", req, AddSearchAttributesResponse.Parser, options);
}

/// <summary>
Expand All @@ -37,9 +37,9 @@ public async Task<AddSearchAttributesResponse> AddSearchAttributesAsync(AddSearc
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<CreateNexusEndpointResponse> CreateNexusEndpointAsync(CreateNexusEndpointRequest req, RpcOptions? options = null)
public Task<CreateNexusEndpointResponse> CreateNexusEndpointAsync(CreateNexusEndpointRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("CreateNexusEndpoint", req, CreateNexusEndpointResponse.Parser, options);
return InvokeRpcAsync("CreateNexusEndpoint", req, CreateNexusEndpointResponse.Parser, options);
}

/// <summary>
Expand All @@ -48,9 +48,9 @@ public async Task<CreateNexusEndpointResponse> CreateNexusEndpointAsync(CreateNe
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<DeleteNamespaceResponse> DeleteNamespaceAsync(DeleteNamespaceRequest req, RpcOptions? options = null)
public Task<DeleteNamespaceResponse> DeleteNamespaceAsync(DeleteNamespaceRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("DeleteNamespace", req, DeleteNamespaceResponse.Parser, options);
return InvokeRpcAsync("DeleteNamespace", req, DeleteNamespaceResponse.Parser, options);
}

/// <summary>
Expand All @@ -59,9 +59,9 @@ public async Task<DeleteNamespaceResponse> DeleteNamespaceAsync(DeleteNamespaceR
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<DeleteNexusEndpointResponse> DeleteNexusEndpointAsync(DeleteNexusEndpointRequest req, RpcOptions? options = null)
public Task<DeleteNexusEndpointResponse> DeleteNexusEndpointAsync(DeleteNexusEndpointRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("DeleteNexusEndpoint", req, DeleteNexusEndpointResponse.Parser, options);
return InvokeRpcAsync("DeleteNexusEndpoint", req, DeleteNexusEndpointResponse.Parser, options);
}

/// <summary>
Expand All @@ -70,9 +70,9 @@ public async Task<DeleteNexusEndpointResponse> DeleteNexusEndpointAsync(DeleteNe
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<GetNexusEndpointResponse> GetNexusEndpointAsync(GetNexusEndpointRequest req, RpcOptions? options = null)
public Task<GetNexusEndpointResponse> GetNexusEndpointAsync(GetNexusEndpointRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("GetNexusEndpoint", req, GetNexusEndpointResponse.Parser, options);
return InvokeRpcAsync("GetNexusEndpoint", req, GetNexusEndpointResponse.Parser, options);
}

/// <summary>
Expand All @@ -81,9 +81,9 @@ public async Task<GetNexusEndpointResponse> GetNexusEndpointAsync(GetNexusEndpoi
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<ListClustersResponse> ListClustersAsync(ListClustersRequest req, RpcOptions? options = null)
public Task<ListClustersResponse> ListClustersAsync(ListClustersRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("ListClusters", req, ListClustersResponse.Parser, options);
return InvokeRpcAsync("ListClusters", req, ListClustersResponse.Parser, options);
}

/// <summary>
Expand All @@ -92,9 +92,9 @@ public async Task<ListClustersResponse> ListClustersAsync(ListClustersRequest re
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<ListNexusEndpointsResponse> ListNexusEndpointsAsync(ListNexusEndpointsRequest req, RpcOptions? options = null)
public Task<ListNexusEndpointsResponse> ListNexusEndpointsAsync(ListNexusEndpointsRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("ListNexusEndpoints", req, ListNexusEndpointsResponse.Parser, options);
return InvokeRpcAsync("ListNexusEndpoints", req, ListNexusEndpointsResponse.Parser, options);
}

/// <summary>
Expand All @@ -103,9 +103,9 @@ public async Task<ListNexusEndpointsResponse> ListNexusEndpointsAsync(ListNexusE
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<ListSearchAttributesResponse> ListSearchAttributesAsync(ListSearchAttributesRequest req, RpcOptions? options = null)
public Task<ListSearchAttributesResponse> ListSearchAttributesAsync(ListSearchAttributesRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("ListSearchAttributes", req, ListSearchAttributesResponse.Parser, options);
return InvokeRpcAsync("ListSearchAttributes", req, ListSearchAttributesResponse.Parser, options);
}

/// <summary>
Expand All @@ -114,9 +114,9 @@ public async Task<ListSearchAttributesResponse> ListSearchAttributesAsync(ListSe
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<RemoveRemoteClusterResponse> RemoveRemoteClusterAsync(RemoveRemoteClusterRequest req, RpcOptions? options = null)
public Task<RemoveRemoteClusterResponse> RemoveRemoteClusterAsync(RemoveRemoteClusterRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("RemoveRemoteCluster", req, RemoveRemoteClusterResponse.Parser, options);
return InvokeRpcAsync("RemoveRemoteCluster", req, RemoveRemoteClusterResponse.Parser, options);
}

/// <summary>
Expand All @@ -125,9 +125,9 @@ public async Task<RemoveRemoteClusterResponse> RemoveRemoteClusterAsync(RemoveRe
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<RemoveSearchAttributesResponse> RemoveSearchAttributesAsync(RemoveSearchAttributesRequest req, RpcOptions? options = null)
public Task<RemoveSearchAttributesResponse> RemoveSearchAttributesAsync(RemoveSearchAttributesRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("RemoveSearchAttributes", req, RemoveSearchAttributesResponse.Parser, options);
return InvokeRpcAsync("RemoveSearchAttributes", req, RemoveSearchAttributesResponse.Parser, options);
}

/// <summary>
Expand All @@ -136,9 +136,9 @@ public async Task<RemoveSearchAttributesResponse> RemoveSearchAttributesAsync(Re
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<UpdateNexusEndpointResponse> UpdateNexusEndpointAsync(UpdateNexusEndpointRequest req, RpcOptions? options = null)
public Task<UpdateNexusEndpointResponse> UpdateNexusEndpointAsync(UpdateNexusEndpointRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("UpdateNexusEndpoint", req, UpdateNexusEndpointResponse.Parser, options);
return InvokeRpcAsync("UpdateNexusEndpoint", req, UpdateNexusEndpointResponse.Parser, options);
}
}
}
24 changes: 12 additions & 12 deletions src/Temporalio/Client/TestService.Rpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public abstract partial class TestService
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<GetCurrentTimeResponse> GetCurrentTimeAsync(Google.Protobuf.WellKnownTypes.Empty req, RpcOptions? options = null)
public Task<GetCurrentTimeResponse> GetCurrentTimeAsync(Google.Protobuf.WellKnownTypes.Empty req, RpcOptions? options = null)
{
return await InvokeRpcAsync("GetCurrentTime", req, GetCurrentTimeResponse.Parser, options);
return InvokeRpcAsync("GetCurrentTime", req, GetCurrentTimeResponse.Parser, options);
}

/// <summary>
Expand All @@ -26,9 +26,9 @@ public async Task<GetCurrentTimeResponse> GetCurrentTimeAsync(Google.Protobuf.We
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<LockTimeSkippingResponse> LockTimeSkippingAsync(LockTimeSkippingRequest req, RpcOptions? options = null)
public Task<LockTimeSkippingResponse> LockTimeSkippingAsync(LockTimeSkippingRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("LockTimeSkipping", req, LockTimeSkippingResponse.Parser, options);
return InvokeRpcAsync("LockTimeSkipping", req, LockTimeSkippingResponse.Parser, options);
}

/// <summary>
Expand All @@ -37,9 +37,9 @@ public async Task<LockTimeSkippingResponse> LockTimeSkippingAsync(LockTimeSkippi
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<SleepResponse> SleepAsync(SleepRequest req, RpcOptions? options = null)
public Task<SleepResponse> SleepAsync(SleepRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("Sleep", req, SleepResponse.Parser, options);
return InvokeRpcAsync("Sleep", req, SleepResponse.Parser, options);
}

/// <summary>
Expand All @@ -48,9 +48,9 @@ public async Task<SleepResponse> SleepAsync(SleepRequest req, RpcOptions? option
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<SleepResponse> SleepUntilAsync(SleepUntilRequest req, RpcOptions? options = null)
public Task<SleepResponse> SleepUntilAsync(SleepUntilRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("SleepUntil", req, SleepResponse.Parser, options);
return InvokeRpcAsync("SleepUntil", req, SleepResponse.Parser, options);
}

/// <summary>
Expand All @@ -59,9 +59,9 @@ public async Task<SleepResponse> SleepUntilAsync(SleepUntilRequest req, RpcOptio
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<UnlockTimeSkippingResponse> UnlockTimeSkippingAsync(UnlockTimeSkippingRequest req, RpcOptions? options = null)
public Task<UnlockTimeSkippingResponse> UnlockTimeSkippingAsync(UnlockTimeSkippingRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("UnlockTimeSkipping", req, UnlockTimeSkippingResponse.Parser, options);
return InvokeRpcAsync("UnlockTimeSkipping", req, UnlockTimeSkippingResponse.Parser, options);
}

/// <summary>
Expand All @@ -70,9 +70,9 @@ public async Task<UnlockTimeSkippingResponse> UnlockTimeSkippingAsync(UnlockTime
/// <param name="req">Request for the call.</param>
/// <param name="options">Optional RPC options.</param>
/// <returns>RPC response</returns>
public async Task<SleepResponse> UnlockTimeSkippingWithSleepAsync(SleepRequest req, RpcOptions? options = null)
public Task<SleepResponse> UnlockTimeSkippingWithSleepAsync(SleepRequest req, RpcOptions? options = null)
{
return await InvokeRpcAsync("UnlockTimeSkippingWithSleep", req, SleepResponse.Parser, options);
return InvokeRpcAsync("UnlockTimeSkippingWithSleep", req, SleepResponse.Parser, options);
}
}
}
Loading

0 comments on commit 43d0f86

Please sign in to comment.