Beispiel #1
0
        internal ErlCRUDSubscription(ErlDataStore store,
                                     string name,
                                     Query query,
                                     Mailbox recipient,
                                     object correlate = null
                                     ) : base(store, name, query, recipient, correlate)
        {
            m_ErlBox = store.MakeMailbox(name);

            m_ErlBox.MailboxMessage += (_, msg) =>
            {
                Task.Run(() => process(msg));
                return(true);
            };

            m_Store = store;
            m_Query = query;
            subscribeCore();
            HasLoaded();
        }
Beispiel #2
0
        internal ErlCRUDSubscription(ErlDataStore store,
                                     string name,
                                     Query query,
                                     Mailbox recipient,
                                     object correlate = null
                                     ) : base(store, name, query, recipient, correlate)
        {
            m_ErlBox = store.MakeMailbox();
            m_Queue  = new ConcurrentQueue <IQueable>();

            m_ErlBox.MailboxMessage += (_, msg) =>
            {
                m_Queue.Enqueue(msg);
                asyncProcess();
                return(true);
            };

            m_Store = store;
            m_Query = query;
            subscribeCore();
            HasLoaded();
        }