コード例 #1
0
 public AsyncMessageBrokerCore(MessagePipeDiagnosticsInfo diagnotics, MessagePipeOptions options)
 {
     this.handlers = new FreeList <IAsyncMessageHandler <TMessage> >();
     this.defaultAsyncPublishStrategy     = options.DefaultAsyncPublishStrategy;
     this.handlingSubscribeDisposedPolicy = options.HandlingSubscribeDisposedPolicy;
     this.diagnotics = diagnotics;
 }
コード例 #2
0
 public MessageBrokerCore(MessagePipeDiagnosticsInfo diagnotics, MessagePipeOptions options)
 {
     this.handlerGroup = new Dictionary <TKey, HandlerHolder>();
     this.diagnotics   = diagnotics;
     this.handlingSubscribeDisposedPolicy = options.HandlingSubscribeDisposedPolicy;
     this.gate = new object();
 }
コード例 #3
0
 async void RunTimer(MessagePipeDiagnosticsInfo diagnosticsInfo)
 {
     while (!cts.IsCancellationRequested)
     {
         // show SubscribeCount
         Console.WriteLine(diagnosticsInfo.SubscribeCount);
         await Task.Delay(TimeSpan.FromSeconds(5), cts.Token);
     }
 }
コード例 #4
0
ファイル: EventFactory.cs プロジェクト: dav1977/MessagePipe
 public EventFactory(
     MessagePipeOptions options,
     MessagePipeDiagnosticsInfo diagnosticsInfo,
     FilterAttachedMessageHandlerFactory handlerFactory,
     FilterAttachedAsyncMessageHandlerFactory asyncHandlerFactory)
 {
     this.options             = options;
     this.diagnosticsInfo     = diagnosticsInfo;
     this.handlerFactory      = handlerFactory;
     this.asyncHandlerFactory = asyncHandlerFactory;
 }
コード例 #5
0
        public Program(
            IPublisher <string, MyMessage> publisher,
            ISubscriber <string, MyMessage> subscriber,
            IPublisher <MyMessage> keyless1,
            ISubscriber <MyMessage> keyless2,

            IAsyncPublisher <MyMessage> asyncKeylessP,
            IAsyncSubscriber <MyMessage> asyncKeylessS,

            IRequestHandler <Ping, Pong> pingponghandler,
            //PingHandler pingpingHandler,
            IRequestAllHandler <Ping, Pong> pingallhandler,

            IPublisher <int> intP,
            ISubscriber <int> intS,
            IServiceScopeFactory scopeF,
            MessagePipeDiagnosticsInfo diagnosticsInfo,

            IServiceProvider provider


            )
        {
            this.provider        = provider;
            this.scopeF          = scopeF;
            this.publisher       = publisher;
            this.subscriber      = subscriber;
            this.keylessP        = keyless1;
            this.keylessS        = keyless2;
            this.asyncKeylessP   = asyncKeylessP;
            this.asyncKeylessS   = asyncKeylessS;
            this.pingponghandler = pingponghandler;
            //this.pingpingHandler = pingpingHandler;
            this.pingallhandler  = pingallhandler;
            this.intPublisher    = intP;
            this.intSubscriber   = intS;
            this.diagnosticsInfo = diagnosticsInfo;

            var r1 = provider.GetRequiredService <IRequestHandler <string, int> >();

            r1.Invoke("foo");
        }
コード例 #6
0
ファイル: MessageBroker.cs プロジェクト: dav1977/MessagePipe
 public MessageBrokerCore(MessagePipeDiagnosticsInfo diagnotics, MessagePipeOptions options)
 {
     this.handlers = new FreeList <IMessageHandler <TMessage> >();
     this.handlingSubscribeDisposedPolicy = options.HandlingSubscribeDisposedPolicy;
     this.diagnotics = diagnotics;
 }
コード例 #7
0
 public ScopedAsyncMessageBrokerCore(MessagePipeDiagnosticsInfo diagnotics, MessagePipeOptions options)
     : base(diagnotics, options)
 {
 }
コード例 #8
0
 public MonitorTimer(MessagePipeDiagnosticsInfo diagnosticsInfo)
 {
     RunTimer(diagnosticsInfo);
 }
コード例 #9
0
 public SingletonMessageBrokerCore(MessagePipeDiagnosticsInfo diagnotics, MessagePipeOptions options)
     : base(diagnotics, options)
 {
 }
コード例 #10
0
 public static void SetProvider(IServiceProvider provider)
 {
     GlobalMessagePipe.provider        = provider;
     GlobalMessagePipe.eventFactory    = provider.GetRequiredService <EventFactory>();
     GlobalMessagePipe.diagnosticsInfo = provider.GetRequiredService <MessagePipeDiagnosticsInfo>();
 }