Esempio n. 1
0
 static async Task CloseSinkAsync(ISink <IMessage> sink, CancellationToken token)
 {
     try
     {
         await sink.CloseAsync(token);
     }
     catch (Exception ex)
     {
         Events.SinkCloseFailed(ex);
     }
 }
Esempio n. 2
0
        public async Task SmokeTask()
        {
            var         factory = new RetryingSinkFactory <int>(new TestSinkFactory <int>(), RetryPolicy.NoRetry);
            ISink <int> sink    = await factory.CreateAsync("hub");

            ISinkResult <int> result = await sink.ProcessAsync(1, CancellationToken.None);

            Assert.True(result.IsSuccessful);
            Assert.Equal(new List <int> {
                1
            }, result.Succeeded);
            Assert.False(result.Failed.Any());
            Assert.False(result.InvalidDetailsList.Any());

            await sink.CloseAsync(CancellationToken.None);
        }