public override Task EnqueueDispatch(SignalDispatch <TKey> dispatch, SignalWriteConcern writeConcern = SignalWriteConcern.Default) { if (_isStarted == false) { ThrowStoppedInstanceError(); } return(base.EnqueueDispatch(dispatch, writeConcern)); }
public virtual SignalWriteConcern GetWriteConcernOrDefault(SignalWriteConcern writeConcern) { if (writeConcern != SignalWriteConcern.Default) { return(writeConcern); } if (DefaultWriteConcern != SignalWriteConcern.Default) { return(DefaultWriteConcern); } return(SignalWriteConcern.MemoryOnly); }
protected virtual async Task EnqueueSignalEvent(SignalEvent <TKey> signalEvent, SignalWriteConcern writeConcern) { writeConcern = _senderSettings.GetWriteConcernOrDefault(writeConcern); bool ensurePersisted = writeConcern == SignalWriteConcern.PersistentStorage; if (ensurePersisted) { await _eventQueries.Insert(new List <SignalEvent <TKey> > { signalEvent }) .ConfigureAwait(false); } var signalWrapper = new SignalWrapper <SignalEvent <TKey> >(signalEvent, ensurePersisted); _eventQueue.Append(signalWrapper); _monitor.EventReceived(signalEvent); }
public virtual Task EnqueueDirectAddressesEvent(SignalDataDto signalDataDto, List <DeliveryAddress> deliveryAddresses, SignalWriteConcern writeConcern = SignalWriteConcern.Default) { var signalEvent = new SignalEvent <TKey>() { AddresseeType = AddresseeType.DirectAddresses, PredefinedAddresses = deliveryAddresses, CreateDateUtc = DateTime.UtcNow, EventKey = signalDataDto.EventKey, TemplateDataDict = signalDataDto.TemplateDataDict, TemplateDataObj = signalDataDto.TemplateDataObj, MachineName = signalDataDto.MachineName, ApplicationName = signalDataDto.ApplicationName }; return(EnqueueSignalEvent(signalEvent, writeConcern)); }
public virtual Task EnqueueDirectSubscriberIdsEvent(SignalDataDto signalDataDto, List <TKey> subscriberIds, string topicId = null, SignalWriteConcern writeConcern = SignalWriteConcern.Default) { var signalEvent = new SignalEvent <TKey>() { AddresseeType = AddresseeType.SubscriberIds, PredefinedSubscriberIds = subscriberIds, TopicId = topicId, CreateDateUtc = DateTime.UtcNow, EventKey = signalDataDto.EventKey, TemplateDataDict = signalDataDto.TemplateDataDict, TemplateDataObj = signalDataDto.TemplateDataObj, MachineName = signalDataDto.MachineName, ApplicationName = signalDataDto.ApplicationName }; return(EnqueueSignalEvent(signalEvent, writeConcern)); }
//methods public virtual Task EnqueueMatchSubscribersEvent(SignalDataDto signalDataDto, Dictionary <string, string> subscriberFiltersData = null, string topicId = null, SignalWriteConcern writeConcern = SignalWriteConcern.Default) { var signalEvent = new SignalEvent <TKey>() { AddresseeType = AddresseeType.SubscriptionParameters, SubscriberFiltersData = subscriberFiltersData, TopicId = topicId, CreateDateUtc = DateTime.UtcNow, EventKey = signalDataDto.EventKey, TemplateDataDict = signalDataDto.TemplateDataDict, TemplateDataObj = signalDataDto.TemplateDataObj, MachineName = signalDataDto.MachineName, ApplicationName = signalDataDto.ApplicationName }; return(EnqueueSignalEvent(signalEvent, writeConcern)); }
public virtual async Task EnqueueDispatch(SignalDispatch <TKey> signalDispatch, SignalWriteConcern writeConcern) { writeConcern = _senderSettings.GetWriteConcernOrDefault(writeConcern); bool ensurePersisted = writeConcern == SignalWriteConcern.PersistentStorage; if (ensurePersisted) { if (_senderSettings.IsDbLockStorageEnabled) { signalDispatch.LockedBy = _senderSettings.LockedByInstanceId; signalDispatch.LockedSinceUtc = DateTime.UtcNow; } await _dispatchQueries.Insert(new List <SignalDispatch <TKey> > { signalDispatch }) .ConfigureAwait(false); } var signalWrapper = new SignalWrapper <SignalDispatch <TKey> >(signalDispatch, ensurePersisted); _dispatchQueue.Append(signalWrapper); _monitor.DispatchTransferred(signalDispatch); }
public Task Dispatch(SignalDispatch <TKey> dispatch, SignalWriteConcern writeConcern = SignalWriteConcern.Default) { return(base.EnqueueDispatch(dispatch, writeConcern)); }
public Task DirectAddressesEvent(SignalDataDC signalDataDto, List <DeliveryAddress> deliveryAddresses, SignalWriteConcern writeConcern = SignalWriteConcern.Default) { return(base.EnqueueDirectAddressesEvent(signalDataDto, deliveryAddresses, writeConcern)); }
public Task DirectSubscriberIdsEvent(SignalDataDC signalDataDto, List <TKey> subscriberIds, string topicId = null, SignalWriteConcern writeConcern = SignalWriteConcern.Default) { return(base.EnqueueDirectSubscriberIdsEvent(signalDataDto, subscriberIds, topicId, writeConcern)); }
public Task MatchSubscribersEvent(SignalDataDC signalDataDto, Dictionary <string, string> subscriberFilters = null, string topicId = null, SignalWriteConcern writeConcern = SignalWriteConcern.Default) { return(base.EnqueueMatchSubscribersEvent(signalDataDto, subscriberFilters, topicId, writeConcern)); }
public override Task EnqueueDirectAddressesEvent(SignalDataDto signalData, List <DeliveryAddress> deliveryAddresses, SignalWriteConcern writeConcern = SignalWriteConcern.Default) { if (_isStarted == false) { ThrowStoppedInstanceError(); } return(base.EnqueueDirectAddressesEvent(signalData, deliveryAddresses, writeConcern)); }
public override Task EnqueueDirectSubscriberIdsEvent(SignalDataDto signalData, List <TKey> subscriberIds, string topicId = null, SignalWriteConcern writeConcern = SignalWriteConcern.Default) { if (_isStarted == false) { ThrowStoppedInstanceError(); } return(base.EnqueueDirectSubscriberIdsEvent(signalData, subscriberIds, topicId, writeConcern)); }
public override Task EnqueueMatchSubscribersEvent(SignalDataDto signalData, Dictionary <string, string> subscriberFiltersData = null, string topicId = null, SignalWriteConcern writeConcern = SignalWriteConcern.Default) { if (_isStarted == false) { ThrowStoppedInstanceError(); } return(base.EnqueueMatchSubscribersEvent(signalData, subscriberFiltersData, topicId, writeConcern)); }