protected virtual void OnReceipt(Subscription subscription, CRUDSubscriptionEvent data, Exception error) { if (Receipt != null) { Receipt(subscription, this, data, error); } }
/// <summary> /// Delivers data to the mailbox. This method is called by subscription /// </summary> public bool Deliver(Subscription subscription, CRUDSubscriptionEvent data) { if (subscription.Store != this.Store) { return(false); } var cap = m_BufferCapacity; if (cap > 0) { lock (m_Buffer) { m_Buffer.AddLast(data); if (m_Buffer.Count > cap) { m_Buffer.RemoveFirst(); } } } OnReceipt(subscription, data, null); return(true); }
protected virtual void OnReceipt(Subscription subscription, CRUDSubscriptionEvent data, Exception error) => Receipt?.Invoke(subscription, this, data, error);