diff options
Diffstat (limited to 'csharp/src/Ice/Process.cs')
-rw-r--r-- | csharp/src/Ice/Process.cs | 16 |
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; } } |