コード例 #1
0
    public async Task Start()
    {
        var position = await _checkpointStore.GetCheckpoint();

        _subscription = _isAllStream
            ? await _client.SubscribeToAllAsync(
            GetAllStreamPosition(),
            EventAppeared,
            subscriptionDropped : SubscriptionDropped)
            : await _client.SubscribeToStreamAsync(
            _streamName,
            GetStreamPosition(),
            EventAppeared
            );

        FromAll GetAllStreamPosition()
        => position.HasValue
                ? FromAll.After(new Position(position.Value, position.Value))
                : FromAll.Start;

        FromStream GetStreamPosition()
        => position.HasValue
                ? FromStream.After(position.Value)
                : FromStream.Start;
    }
コード例 #2
0
        public async Task Start()
        {
            var settings = new CatchUpSubscriptionSettings(
                2000
                , 500
                , _log.IsEnabled(LogEventLevel.Debug)
                , false);

            _log.Information("Starting the subscription manager...");

            var position = await _checkpointStore.GetCheckpoint();

            _log.Information("Retrieved the checkpoint: {checkpoint}", position);

            var _subscription = _connection.SubscribeToAllFrom(position
                                                               , settings
                                                               , EventAppeared
                                                               , LiveProcessingStarted
                                                               , SubscriptionDropped);

            // var _subscription = _connection.SubscribeToStreamFrom("$all"
            //                                                         ,position.Value.CommitPosition
            //                                                         , settings
            //                                                         , EventAppeared
            //                                                         , LiveProcessingStarted
            //                                                         , SubscriptionDropped);

            _log.Information("Subscribed to $all stream");
        }
コード例 #3
0
        public async Task Start()
        {
            var settings = new CatchUpSubscriptionSettings(
                2000, 500,
                Log.IsDebugEnabled(),
                false, _name
                );

            Log.Debug("Starting the projection manager...");

            var position = await _checkpointStore.GetCheckpoint();

            Log.Debug("Retrieved the checkpoint: {checkpoint}", position);

            _subscription = _connection.SubscribeToAllFrom(
                GetPosition(),
                settings,
                EventAppeared
                );
            Log.Debug("Subscribed to $all stream");

            Position?GetPosition()
            => position.HasValue
                    ? new Position(position.Value, position.Value)
                    : AllCheckpoint.AllStart;
        }
コード例 #4
0
        public async Task Start()
        {
            var settings = new CatchUpSubscriptionSettings(2000, 500,
                                                           Log.IsEnabled(LogEventLevel.Verbose),
                                                           false, "try-out-subscription");

            var position = await _checkpointStore.GetCheckpoint();

            _subscription = _connection.SubscribeToAllFrom(position, settings, EventAppeared);
        }
コード例 #5
0
        public async Task Start()
        {
            var settings = new CatchUpSubscriptionSettings(
                2000, 500,
                Log.IsEnabled(LogEventLevel.Verbose),
                false, "try-out-subscription"
                );

            Log.Debug("Starting the projection manager...");

            var position = await _checkpointStore.GetCheckpoint();

            Log.Debug("Retrieved the checkpoint: {checkpoint}", position);

            _subscription = _connection.SubscribeToAllFrom(
                position,
                settings, EventAppeared
                );
            Log.Debug("Subscribed to $all stream");
        }