Esempio n. 1
0
        public (IDisposableAsyncPublisher <T>, IAsyncSubscriber <T>) CreateAsyncEvent <T>()
        {
            var core       = new AsyncMessageBrokerCore <T>(diagnosticsInfo, options);
            var publisher  = new DisposableAsyncPublisher <T>(core);
            var subscriber = new AsyncMessageBroker <T>(core, asyncHandlerFactory);

            return(publisher, subscriber);
        }
Esempio n. 2
0
        public (IDisposableBufferedAsyncPublisher <T>, IBufferedAsyncSubscriber <T>) CreateBufferedAsyncEvent <T>(T initialValue)
        {
            var innerCore  = new AsyncMessageBrokerCore <T>(diagnosticsInfo, options);
            var core       = new BufferedAsyncMessageBrokerCore <T>(innerCore);
            var broker     = new BufferedAsyncMessageBroker <T>(core, asyncHandlerFactory);
            var publisher  = new DisposableBufferedAsyncPublisher <T>(broker, innerCore);
            var subscriber = broker;

            publisher.Publish(initialValue, CancellationToken.None); // set initial value is completely sync.
            return(publisher, subscriber);
        }
Esempio n. 3
0
 public AsyncMessageBroker(AsyncMessageBrokerCore <TKey, TMessage> core, FilterAttachedAsyncMessageHandlerFactory handlerFactory)
 {
     this.core           = core;
     this.handlerFactory = handlerFactory;
 }
Esempio n. 4
0
 public HandlerHolder(AsyncMessageBrokerCore <TKey, TMessage> core)
 {
     this.handlers = new FreeList <IAsyncMessageHandler <TMessage> >();
     this.core     = core;
 }
Esempio n. 5
0
 public BufferedAsyncMessageBrokerCore(AsyncMessageBrokerCore <TMessage> core)
 {
     this.core        = core;
     this.lastMessage = default;
 }
Esempio n. 6
0
 public Subscription(AsyncMessageBrokerCore <TMessage> core, int subscriptionKey)
 {
     this.core            = core;
     this.subscriptionKey = subscriptionKey;
 }
Esempio n. 7
0
 public DisposableAsyncPublisher(AsyncMessageBrokerCore <TMessage> core)
 {
     this.core = core;
 }