/// <summary>
        /// Creates a new instance using the provided context and registers this instance for automatic discovery if needed.
        /// </summary>
        /// <param name="serviceContext"></param>
        /// <param name="enableAutoDiscovery"></param>
        /// <param name="brokerEventsManager"></param>
        protected BrokerServiceBase(StatefulServiceContext serviceContext, bool enableAutoDiscovery = true, IBrokerEventsManager brokerEventsManager = null)
            : base(serviceContext)
        {
            if (enableAutoDiscovery)
            {
                new BrokerServiceLocator(Context.ServiceName).RegisterAsync()
                .ConfigureAwait(false)
                .GetAwaiter()
                .GetResult();
            }

            BrokerEventsManager = brokerEventsManager ?? new DefaultBrokerEventsManager();
        }
        /// <summary>
        /// Creates a new instance using the provided context and registers this instance for automatic discovery if needed.
        /// </summary>
        /// <param name="serviceContext"></param>
        /// <param name="enableAutoDiscovery"></param>
        /// <param name="brokerEventsManager"></param>
        protected BrokerService(StatefulServiceContext serviceContext, bool enableAutoDiscovery = true, IBrokerEventsManager brokerEventsManager = null, IProxyFactories proxyFactories = null)
            : base(serviceContext)
        {
            if (enableAutoDiscovery)
            {
                new BrokerServiceLocator(Context.ServiceName).RegisterAsync()
                .ConfigureAwait(false)
                .GetAwaiter()
                .GetResult();
            }

            _brokerEventsManager = brokerEventsManager ?? new DefaultBrokerEventsManager();
            _subscriptionFactory = new SubscriptionFactory(StateManager);
            _proxyFactories      = proxyFactories ?? new ProxyFactories();
        }
Esempio n. 3
0
 public MockBrokerServiceWithEvents(StatefulServiceContext serviceContext, IReliableStateManagerReplica2 reliableStateManagerReplica, bool enableAutoDiscovery = false, IBrokerEventsManager brokerEventsManager = null) : base(serviceContext, reliableStateManagerReplica, enableAutoDiscovery, brokerEventsManager)
 {
     DueTime = TimeSpan.Zero;
     Period  = TimeSpan.FromMilliseconds(50);
 }
Esempio n. 4
0
 public MockBrokerServiceWithEvents(StatefulServiceContext serviceContext, bool enableAutoDiscovery = false, IBrokerEventsManager brokerEventsManager = null) : base(serviceContext, enableAutoDiscovery, brokerEventsManager)
 {
 }
 /// <summary>
 /// Creates a new instance using the provided context and registers this instance for automatic discovery if needed.
 /// </summary>
 /// <param name="serviceContext"></param>
 /// <param name="reliableStateManagerReplica"></param>
 /// <param name="enableAutoDiscovery"></param>
 /// <param name="brokerEventsManager"></param>
 protected BrokerServiceUnordered(StatefulServiceContext serviceContext, IReliableStateManagerReplica2 reliableStateManagerReplica, bool enableAutoDiscovery = true, IBrokerEventsManager brokerEventsManager = null)
     : base(serviceContext, reliableStateManagerReplica, enableAutoDiscovery, brokerEventsManager)
 {
 }
Esempio n. 6
0
 /// <summary>
 /// Creates a new instance using the provided context and registers this instance for automatic discovery if needed.
 /// </summary>
 /// <param name="serviceContext"></param>
 /// <param name="enableAutoDiscovery"></param>
 /// <param name="brokerEventsManager"></param>
 protected BrokerService(StatefulServiceContext serviceContext, bool enableAutoDiscovery = true, IBrokerEventsManager brokerEventsManager = null)
     : base(serviceContext, enableAutoDiscovery, brokerEventsManager)
 {
 }