Exemplo n.º 1
0
        public SiloProviderRuntime(
            ILocalSiloDetails siloDetails,
            IOptions <ClusterOptions> clusterOptions,
            IConsistentRingProvider consistentRingProvider,
            ISiloRuntimeClient runtimeClient,
            ImplicitStreamSubscriberTable implicitStreamSubscriberTable,
            ISiloStatusOracle siloStatusOracle,
            OrleansTaskScheduler scheduler,
            ActivationDirectory activationDirectory,
            ILoggerFactory loggerFactory)
        {
            this.loggerFactory          = loggerFactory;
            this.siloStatusOracle       = siloStatusOracle;
            this.scheduler              = scheduler;
            this.activationDirectory    = activationDirectory;
            this.consistentRingProvider = consistentRingProvider;
            this.runtimeClient          = runtimeClient;
            this.ServiceId              = clusterOptions.Value.ServiceId;
            this.SiloIdentity           = siloDetails.SiloAddress.ToLongString();

            this.grainBasedPubSub = new GrainBasedPubSubRuntime(this.GrainFactory);
            var tmp = new ImplicitStreamPubSub(this.runtimeClient.InternalGrainFactory, implicitStreamSubscriberTable);

            this.implictPubSub = tmp;
            this.combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(this.grainBasedPubSub, tmp);
        }
Exemplo n.º 2
0
        public SiloProviderRuntime(
            SiloInitializationParameters siloDetails,
            GlobalConfiguration config,
            IGrainFactory grainFactory,
            IConsistentRingProvider consistentRingProvider,
            ISiloRuntimeClient runtimeClient,
            IServiceProvider serviceProvider,
            ImplicitStreamSubscriberTable implicitStreamSubscriberTable,
            ISiloStatusOracle siloStatusOracle,
            OrleansTaskScheduler scheduler,
            ActivationDirectory activationDirectory)
        {
            this.siloDetails            = siloDetails;
            this.siloStatusOracle       = siloStatusOracle;
            this.scheduler              = scheduler;
            this.activationDirectory    = activationDirectory;
            this.consistentRingProvider = consistentRingProvider;
            this.runtimeClient          = runtimeClient;
            this.ServiceId              = config.ServiceId;
            this.SiloIdentity           = siloDetails.SiloAddress.ToLongString();
            this.GrainFactory           = grainFactory;
            this.ServiceProvider        = serviceProvider;

            this.grainBasedPubSub = new GrainBasedPubSubRuntime(this.GrainFactory);
            var tmp = new ImplicitStreamPubSub(implicitStreamSubscriberTable);

            this.implictPubSub = tmp;
            this.combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(this.grainBasedPubSub, tmp);
        }
Exemplo n.º 3
0
        public static void StreamingInitialize(IGrainFactory grainFactory, ImplicitStreamSubscriberTable implicitStreamSubscriberTable)
        {
            Instance.implicitStreamSubscriberTable = implicitStreamSubscriberTable;
            Instance.grainBasedPubSub = new GrainBasedPubSubRuntime(grainFactory);
            var tmp = new ImplicitStreamPubSub(implicitStreamSubscriberTable);

            Instance.implictPubSub = tmp;
            Instance.combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(Instance.grainBasedPubSub, tmp);
        }
        public void StreamingInitialize()
        {
            grainBasedPubSub = new GrainBasedPubSubRuntime(GrainFactory);
            var tmp = new ImplicitStreamPubSub(this.grainFactory, this.implicitSubscriberTable);

            implicitPubSub = tmp;
            combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(grainBasedPubSub, tmp);
            streamDirectory = new StreamDirectory();
        }
Exemplo n.º 5
0
        public void StreamingInitialize(ImplicitStreamSubscriberTable implicitStreamSubscriberTable)
        {
            if (null == implicitStreamSubscriberTable)
            {
                throw new ArgumentNullException("implicitStreamSubscriberTable");
            }
            grainBasedPubSub = new GrainBasedPubSubRuntime(GrainFactory);
            var tmp = new ImplicitStreamPubSub(implicitStreamSubscriberTable);

            implictPubSub = tmp;
            combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(grainBasedPubSub, tmp);
            streamDirectory = new StreamDirectory();
        }
Exemplo n.º 6
0
        public void StreamingInitialize()
        {
            this.implicitStreamSubscriberTable = new ImplicitStreamSubscriberTable();
            this.grainBasedPubSub = new GrainBasedPubSubRuntime(this.GrainFactory);
            var tmp = new ImplicitStreamPubSub(this.implicitStreamSubscriberTable);

            this.implictPubSub = tmp;
            this.combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(this.grainBasedPubSub, tmp);

            var typeManager = this.ServiceProvider.GetRequiredService <GrainTypeManager>();

            Type[] types = typeManager.GrainClassTypeData.Select(t => t.Value.Type).ToArray();
            this.ImplicitStreamSubscriberTable.InitImplicitStreamSubscribers(types);
        }
Exemplo n.º 7
0
        public SiloStreamProviderRuntime(
            IConsistentRingProvider consistentRingProvider,
            InsideRuntimeClient runtimeClient,
            ImplicitStreamSubscriberTable implicitStreamSubscriberTable,
            ILoggerFactory loggerFactory,
            ILocalSiloDetails siloDetails,
            IGrainContextAccessor grainContextAccessor)
        {
            this.loggerFactory          = loggerFactory;
            this.siloDetails            = siloDetails;
            this.grainContextAccessor   = grainContextAccessor;
            this.consistentRingProvider = consistentRingProvider;
            this.runtimeClient          = runtimeClient;
            this.logger           = this.loggerFactory.CreateLogger <SiloProviderRuntime>();
            this.grainBasedPubSub = new GrainBasedPubSubRuntime(this.GrainFactory);
            var tmp = new ImplicitStreamPubSub(this.runtimeClient.InternalGrainFactory, implicitStreamSubscriberTable);

            this.implictPubSub = tmp;
            this.combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(this.grainBasedPubSub, tmp);
        }
        public ClientStreamingProviderRuntime(
            IInternalGrainFactory grainFactory,
            IServiceProvider serviceProvider,
            ILoggerFactory loggerFactory,
            ImplicitStreamSubscriberTable implicitSubscriberTable,
            ClientGrainContext clientContext)
        {
            this.grainFactory            = grainFactory;
            this.ServiceProvider         = serviceProvider;
            this.implicitSubscriberTable = implicitSubscriberTable;
            this.clientContext           = clientContext;
            this.runtimeClient           = serviceProvider.GetService <IRuntimeClient>();
            //all async timer created through current class all share this logger for perf reasons
            this.timerLogger = loggerFactory.CreateLogger <AsyncTaskSafeTimer>();
            grainBasedPubSub = new GrainBasedPubSubRuntime(GrainFactory);
            var tmp = new ImplicitStreamPubSub(this.grainFactory, this.implicitSubscriberTable);

            implicitPubSub = tmp;
            combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(grainBasedPubSub, tmp);
            streamDirectory = new StreamDirectory();
        }
Exemplo n.º 9
0
        public SiloProviderRuntime(
            IConsistentRingProvider consistentRingProvider,
            ISiloRuntimeClient runtimeClient,
            ImplicitStreamSubscriberTable implicitStreamSubscriberTable,
            OrleansTaskScheduler scheduler,
            ActivationDirectory activationDirectory,
            ILoggerFactory loggerFactory,
            ILocalSiloDetails siloDetails)
        {
            this.loggerFactory          = loggerFactory;
            this.siloDetails            = siloDetails;
            this.scheduler              = scheduler;
            this.activationDirectory    = activationDirectory;
            this.consistentRingProvider = consistentRingProvider;
            this.runtimeClient          = runtimeClient;
            this.logger           = this.loggerFactory.CreateLogger <SiloProviderRuntime>();
            this.grainBasedPubSub = new GrainBasedPubSubRuntime(this.GrainFactory);
            var tmp = new ImplicitStreamPubSub(this.runtimeClient.InternalGrainFactory, implicitStreamSubscriberTable);

            this.implictPubSub = tmp;
            this.combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(this.grainBasedPubSub, tmp);
        }
Exemplo n.º 10
0
        public SiloProviderRuntime(
            Silo silo,
            GlobalConfiguration config,
            IGrainFactory grainFactory,
            IConsistentRingProvider consistentRingProvider,
            ISiloRuntimeClient runtimeClient,
            IServiceProvider serviceProvider,
            ImplicitStreamSubscriberTable implicitStreamSubscriberTable)
        {
            this.silo = silo;
            this.consistentRingProvider = consistentRingProvider;
            this.runtimeClient          = runtimeClient;
            this.ServiceId       = config.ServiceId;
            this.SiloIdentity    = silo.SiloAddress.ToLongString();
            this.GrainFactory    = grainFactory;
            this.ServiceProvider = serviceProvider;

            this.grainBasedPubSub = new GrainBasedPubSubRuntime(this.GrainFactory);
            var tmp = new ImplicitStreamPubSub(implicitStreamSubscriberTable);

            this.implictPubSub = tmp;
            this.combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(this.grainBasedPubSub, tmp);
        }