summaryrefslogtreecommitdiff
path: root/csharp/src/Ice/Process.cs
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2021-01-14 12:12:47 -0500
committerGitHub <noreply@github.com>2021-01-14 12:12:47 -0500
commit05edde5bcae0e5ee6b31bdb9923a8e5bb80fede1 (patch)
treefae64c8758ed0226c7bc005ce9372c6a511b643c /csharp/src/Ice/Process.cs
parentMoved alias test from Slice to Ice test directory. (diff)
downloadice-before_streamline.tar.bz2
ice-before_streamline.tar.xz
ice-before_streamline.zip
Switch to Async skeletons in Ice core (#1240)before_streamline
Diffstat (limited to 'csharp/src/Ice/Process.cs')
-rw-r--r--csharp/src/Ice/Process.cs16
1 files changed, 11 insertions, 5 deletions
diff --git a/csharp/src/Ice/Process.cs b/csharp/src/Ice/Process.cs
index 250c38b9098..2372df1418f 100644
--- a/csharp/src/Ice/Process.cs
+++ b/csharp/src/Ice/Process.cs
@@ -1,25 +1,31 @@
// Copyright (c) ZeroC, Inc. All rights reserved.
+using System;
using System.Threading;
+using System.Threading.Tasks;
namespace ZeroC.Ice
{
// Default implementation of the Process Admin facet.
- internal sealed class Process : IProcess
+ internal sealed class Process : IAsyncProcess
{
private readonly Communicator _communicator;
- public void Shutdown(Current current, CancellationToken cancel) => _ = _communicator.ShutdownAsync();
+ public ValueTask ShutdownAsync(Current current, CancellationToken cancel)
+ {
+ _ = _communicator.ShutdownAsync(); // we can't wait for shutdown to complete
+ return default;
+ }
- public void WriteMessage(string message, int fd, Current current, CancellationToken cancel)
+ public async ValueTask WriteMessageAsync(string message, int fd, Current current, CancellationToken cancel)
{
switch (fd)
{
case 1:
- System.Console.Out.WriteLine(message);
+ await Console.Out.WriteLineAsync(message).ConfigureAwait(false);
break;
case 2:
- System.Console.Error.WriteLine(message);
+ await Console.Error.WriteLineAsync(message).ConfigureAwait(false);
break;
}
}