Esempio n. 1
0
        Task Init(CancellationToken cancellation)
        {
            StreamPubSubWrapper.Hook(services, providers, stream =>
                                     StreamSubscriptionSpecification
                                     .Match(system, stream.Id, subscriptions.Find(stream.Provider))
                                     .Select(x => new StreamPubSubMatch(x.Receive))
                                     .ToArray());

            return(Task.CompletedTask);
        }
        public Task Init(string name, IProviderRuntime providerRuntime, IProviderConfiguration config)
        {
            var system    = ClusterActorSystem.Current;
            var providers = config.Properties["providers"].Split(';');

            StreamPubSubWrapper.Hook(providerRuntime.ServiceProvider, providers, stream =>
                                     StreamSubscriptionMatcher
                                     .Match(system, stream)
                                     .Select(x => new StreamPubSubMatch(x.Receive))
                                     .ToArray());

            return(TaskDone.Done);
        }
        public Task Init(string name, IProviderRuntime runtime, IProviderConfiguration configuration)
        {
            var system    = runtime.ServiceProvider.GetRequiredService <IActorSystem>();
            var providers = configuration.Properties["providers"].Split(';');

            StreamPubSubWrapper.Hook(runtime.ServiceProvider, providers, stream =>
                                     StreamSubscriptionMatcher
                                     .Match(system, stream)
                                     .Select(x => new StreamPubSubMatch(x.Receive))
                                     .ToArray());

            return(Task.CompletedTask);
        }