Example #1
0
        public TransformData(ILogger <TransformData> logger, AsyncActionSubscriptionFactory subscriptionFactory, PublisherFactory publisherFactory)
        {
            if (logger is null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            if (subscriptionFactory is null)
            {
                throw new ArgumentNullException(nameof(subscriptionFactory));
            }

            if (publisherFactory is null)
            {
                throw new ArgumentNullException(nameof(publisherFactory));
            }

            var pattern = new PatternBuilder("playground")
                          .With("data")
                          .With("rng")
                          .Build();

            this.subscription = subscriptionFactory.Create(pattern, this.TransformAsync);
            this.publisher    = publisherFactory.Create();
            this.logger       = logger;
        }
Example #2
0
        public SaveData(ILogger <SaveData> logger, AsyncActionSubscriptionFactory subscriptionFactory)
        {
            if (logger is null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            if (subscriptionFactory is null)
            {
                throw new ArgumentNullException(nameof(subscriptionFactory));
            }

            var pattern = new PatternBuilder("playground")
                          .With("data")
                          .With("ascii")
                          .Build();

            this.subscription = subscriptionFactory.Create(pattern, this.SimulateSaveData);
            this.logger       = logger;
        }