Beispiel #1
0
        public override async Task OnActivateAsync()
        {
            var provider = GetStreamProvider(Consts.KafkaStreamProvider);

            _stream = provider.GetStream <TestModel>(Consts.StreamId, Consts.StreamNamespace);

            _model      = TestModel.Random();
            _completion = new TaskCompletionSource <TestResult>();

            await _stream.QuickSubscribe((actual, token) =>
            {
                _completion.SetResult(new TestResult
                {
                    Actual   = actual,
                    Expected = _model
                });

                return(Task.CompletedTask);
            });
        }