System.Threading.Tasks.Task.FromResult(TransportMessage)

Here are the examples of the csharp api System.Threading.Tasks.Task.FromResult(TransportMessage) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 Source : DrainableInMemTransport.cs
with MIT License
from ARKlab

public override Task<TransportMessage> Receive(ITransactionContext context, CancellationToken cancellationToken)
        {
            if (Interlocked.CompareExchange(ref _drain, 1, 0) != -1)
            {
                return Task.FromResult<TransportMessage>(null);
            }
            return base.Receive(context, cancellationToken);
        }