Beispiel #1
0
        internal static async Task <Message> HelpReceiveAsync(IInputChannel channel, CancellationToken token)
        {
            var result = await channel.TryReceiveAsync(token);

            if (result.Success)
            {
                return(result.Result);
            }
            else
            {
                // TODO: Derive CancellationToken to carry timeout
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateReceiveTimedOutException(channel, TimeSpan.Zero));
            }
        }