Skip to main content

MemoryServerEvents

Assembly: ServiceStack.dll​
View Source​
Declaration
public class MemoryServerEvents : IServerEvents, IDisposable

Properties​

IdleTimeout​

View Source​
Declaration
public TimeSpan IdleTimeout { get; set; }

HouseKeepingInterval​

View Source​
Declaration
public TimeSpan HouseKeepingInterval { get; set; }

OnSubscribeAsync​

View Source​
Declaration
public Func<IEventSubscription, Task> OnSubscribeAsync { get; set; }

OnUnsubscribeAsync​

View Source​
Declaration
public Func<IEventSubscription, Task> OnUnsubscribeAsync { get; set; }

OnUpdateAsync​

View Source​
Declaration
public Func<IEventSubscription, Task> OnUpdateAsync { get; set; }

OnRemoveSubscriptionAsync​

View Source​
Declaration
public Func<IEventSubscription, Task> OnRemoveSubscriptionAsync { get; set; }

NotifyJoinAsync​

View Source​
Declaration
public Func<IEventSubscription, Task> NotifyJoinAsync { get; set; }

NotifyLeaveAsync​

View Source​
Declaration
public Func<IEventSubscription, Task> NotifyLeaveAsync { get; set; }

NotifyUpdateAsync​

View Source​
Declaration
public Func<IEventSubscription, Task> NotifyUpdateAsync { get; set; }

NotifyHeartbeatAsync​

View Source​
Declaration
public Func<IEventSubscription, Task> NotifyHeartbeatAsync { get; set; }

Serialize​

View Source​
Declaration
public Func<object, string> Serialize { get; set; }

NotifyChannelOfSubscriptions​

View Source​
Declaration
public bool NotifyChannelOfSubscriptions { get; set; }

OnError​

View Source​
Declaration
public Action<IEventSubscription, Exception> OnError { get; set; }

Fields​

FlushNopOnSubscription​

View Source​
Declaration
public static bool FlushNopOnSubscription

Subscriptions​

View Source​
Declaration
public ConcurrentDictionary<string, IEventSubscription> Subscriptions

ChannelSubscriptions​

View Source​
Declaration
public ConcurrentDictionary<string, ConcurrentDictionary<IEventSubscription, bool>> ChannelSubscriptions

UserIdSubscriptions​

View Source​
Declaration
public ConcurrentDictionary<string, ConcurrentDictionary<IEventSubscription, bool>> UserIdSubscriptions

UserNameSubscriptions​

View Source​
Declaration
public ConcurrentDictionary<string, ConcurrentDictionary<IEventSubscription, bool>> UserNameSubscriptions

SessionSubscriptions​

View Source​
Declaration
public ConcurrentDictionary<string, ConcurrentDictionary<IEventSubscription, bool>> SessionSubscriptions

Methods​

Reset()​

View Source​
Declaration
public void Reset()

Start()​

View Source​
Declaration
public void Start()

Stop()​

View Source​
Declaration
public void Stop()

StopAsync()​

View Source​
Declaration
public async Task StopAsync()
Returns​

System.Threading.Tasks.Task

NotifyAll(String, Object)​

View Source​
Declaration
public void NotifyAll(string selector, object message)
Parameters​
TypeName
System.Stringselector
System.Objectmessage

NotifyAllAsync(String, Object, CancellationToken)​

View Source​
Declaration
public async Task NotifyAllAsync(string selector, object message, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.Stringselector
System.Objectmessage
System.Threading.CancellationTokentoken

NotifyAllJsonAsync(String, String, CancellationToken)​

View Source​
Declaration
public async Task NotifyAllJsonAsync(string selector, string json, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.Stringselector
System.Stringjson
System.Threading.CancellationTokentoken

NotifyChannelsAsync(String[], String, String, CancellationToken)​

View Source​
Declaration
public async Task NotifyChannelsAsync(string[] channels, string selector, string body, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.String[]channels
System.Stringselector
System.Stringbody
System.Threading.CancellationTokentoken

NotifySubscription(String, String, Object, String)​

View Source​
Declaration
public void NotifySubscription(string subscriptionId, string selector, object message, string channel = null)
Parameters​
TypeName
System.StringsubscriptionId
System.Stringselector
System.Objectmessage
System.Stringchannel

NotifySubscriptionAsync(String, String, Object, String, CancellationToken)​

View Source​
Declaration
public Task NotifySubscriptionAsync(string subscriptionId, string selector, object message, string channel = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.StringsubscriptionId
System.Stringselector
System.Objectmessage
System.Stringchannel
System.Threading.CancellationTokentoken

NotifySubscriptionJsonAsync(String, String, String, String, CancellationToken)​

View Source​
Declaration
public Task NotifySubscriptionJsonAsync(string subscriptionId, string selector, string json, string channel = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.StringsubscriptionId
System.Stringselector
System.Stringjson
System.Stringchannel
System.Threading.CancellationTokentoken

NotifyChannel(String, String, Object)​

View Source​
Declaration
public void NotifyChannel(string channel, string selector, object message)
Parameters​
TypeName
System.Stringchannel
System.Stringselector
System.Objectmessage

NotifyChannelAsync(String, String, Object, CancellationToken)​

View Source​
Declaration
public Task NotifyChannelAsync(string channel, string selector, object message, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.Stringchannel
System.Stringselector
System.Objectmessage
System.Threading.CancellationTokentoken

NotifyChannelJsonAsync(String, String, String, CancellationToken)​

View Source​
Declaration
public Task NotifyChannelJsonAsync(string channel, string selector, string json, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.Stringchannel
System.Stringselector
System.Stringjson
System.Threading.CancellationTokentoken

NotifyUserId(String, String, Object, String)​

View Source​
Declaration
public void NotifyUserId(string userId, string selector, object message, string channel = null)
Parameters​
TypeName
System.StringuserId
System.Stringselector
System.Objectmessage
System.Stringchannel

NotifyUserIdAsync(String, String, Object, String, CancellationToken)​

View Source​
Declaration
public Task NotifyUserIdAsync(string userId, string selector, object message, string channel = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.StringuserId
System.Stringselector
System.Objectmessage
System.Stringchannel
System.Threading.CancellationTokentoken

NotifyUserIdJsonAsync(String, String, String, String, CancellationToken)​

View Source​
Declaration
public Task NotifyUserIdJsonAsync(string userId, string selector, string json, string channel = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.StringuserId
System.Stringselector
System.Stringjson
System.Stringchannel
System.Threading.CancellationTokentoken

NotifyUserName(String, String, Object, String)​

View Source​
Declaration
public void NotifyUserName(string userName, string selector, object message, string channel = null)
Parameters​
TypeName
System.StringuserName
System.Stringselector
System.Objectmessage
System.Stringchannel

NotifyUserNameAsync(String, String, Object, String, CancellationToken)​

View Source​
Declaration
public Task NotifyUserNameAsync(string userName, string selector, object message, string channel = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.StringuserName
System.Stringselector
System.Objectmessage
System.Stringchannel
System.Threading.CancellationTokentoken

NotifyUserNameJsonAsync(String, String, String, String, CancellationToken)​

View Source​
Declaration
public Task NotifyUserNameJsonAsync(string userName, string selector, string json, string channel = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.StringuserName
System.Stringselector
System.Stringjson
System.Stringchannel
System.Threading.CancellationTokentoken

NotifySession(String, String, Object, String)​

View Source​
Declaration
public void NotifySession(string sessionId, string selector, object message, string channel = null)
Parameters​
TypeName
System.StringsessionId
System.Stringselector
System.Objectmessage
System.Stringchannel

NotifySessionAsync(String, String, Object, String, CancellationToken)​

View Source​
Declaration
public Task NotifySessionAsync(string sessionId, string selector, object message, string channel = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.StringsessionId
System.Stringselector
System.Objectmessage
System.Stringchannel
System.Threading.CancellationTokentoken

NotifySessionJsonAsync(String, String, String, String, CancellationToken)​

View Source​
Declaration
public Task NotifySessionJsonAsync(string sessionId, string selector, string json, string channel = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.StringsessionId
System.Stringselector
System.Stringjson
System.Stringchannel
System.Threading.CancellationTokentoken

GetStats()​

View Source​
Declaration
public Dictionary<string, string> GetStats()
Returns​

System.Collections.Generic.Dictionary<System.String,System.String>

RegisterHungConnection(IEventSubscription)​

View Source​
Declaration
public void RegisterHungConnection(IEventSubscription sub)
Parameters​
TypeName
ServiceStack.IEventSubscriptionsub

QueueAsyncTask(Func<Task>)​

View Source​
Declaration
public void QueueAsyncTask(Func<Task> task)
Parameters​
TypeName
System.Func<System.Threading.Tasks.Task>task

GetMemoryServerEvents()​

View Source​
Declaration
public MemoryServerEvents GetMemoryServerEvents()
Returns​

ServiceStack.MemoryServerEvents

NotifyRaw(ConcurrentDictionary<String, ConcurrentDictionary<IEventSubscription, Boolean>>, String, String, String, String)​

View Source​
Declaration
protected void NotifyRaw(ConcurrentDictionary<string, ConcurrentDictionary<IEventSubscription, bool>> map, string key, string selector, string body, string channel = null)
Parameters​
TypeName
System.Collections.Concurrent.ConcurrentDictionary<System.String,System.Collections.Concurrent.ConcurrentDictionary<ServiceStack.IEventSubscription,System.Boolean>>map
System.Stringkey
System.Stringselector
System.Stringbody
System.Stringchannel

Notify(ConcurrentDictionary<String, ConcurrentDictionary<IEventSubscription, Boolean>>, String, String, Object, String)​

View Source​
Declaration
protected void Notify(ConcurrentDictionary<string, ConcurrentDictionary<IEventSubscription, bool>> map, string key, string selector, object message, string channel = null)
Parameters​
TypeName
System.Collections.Concurrent.ConcurrentDictionary<System.String,System.Collections.Concurrent.ConcurrentDictionary<ServiceStack.IEventSubscription,System.Boolean>>map
System.Stringkey
System.Stringselector
System.Objectmessage
System.Stringchannel

Notify(ConcurrentDictionary<String, IEventSubscription>, String, String, Object, String)​

View Source​
Declaration
protected void Notify(ConcurrentDictionary<string, IEventSubscription> map, string key, string selector, object message, string channel = null)
Parameters​
TypeName
System.Collections.Concurrent.ConcurrentDictionary<System.String,ServiceStack.IEventSubscription>map
System.Stringkey
System.Stringselector
System.Objectmessage
System.Stringchannel

NotifyRawAsync(ConcurrentDictionary<String, ConcurrentDictionary<IEventSubscription, Boolean>>, String, String, String, String, CancellationToken)​

View Source​
Declaration
protected async Task NotifyRawAsync(ConcurrentDictionary<string, ConcurrentDictionary<IEventSubscription, bool>> map, string key, string selector, string body, string channel = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.Collections.Concurrent.ConcurrentDictionary<System.String,System.Collections.Concurrent.ConcurrentDictionary<ServiceStack.IEventSubscription,System.Boolean>>map
System.Stringkey
System.Stringselector
System.Stringbody
System.Stringchannel
System.Threading.CancellationTokentoken

NotifyAsync(ConcurrentDictionary<String, ConcurrentDictionary<IEventSubscription, Boolean>>, String, String, Object, String, CancellationToken)​

View Source​
Declaration
protected Task NotifyAsync(ConcurrentDictionary<string, ConcurrentDictionary<IEventSubscription, bool>> map, string key, string selector, object message, string channel = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.Collections.Concurrent.ConcurrentDictionary<System.String,System.Collections.Concurrent.ConcurrentDictionary<ServiceStack.IEventSubscription,System.Boolean>>map
System.Stringkey
System.Stringselector
System.Objectmessage
System.Stringchannel
System.Threading.CancellationTokentoken

NotifyRawAsync(ConcurrentDictionary<String, IEventSubscription>, String, String, String, String, CancellationToken)​

View Source​
Declaration
protected async Task NotifyRawAsync(ConcurrentDictionary<string, IEventSubscription> map, string key, string selector, string body, string channel = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.Collections.Concurrent.ConcurrentDictionary<System.String,ServiceStack.IEventSubscription>map
System.Stringkey
System.Stringselector
System.Stringbody
System.Stringchannel
System.Threading.CancellationTokentoken

NotifyAsync(ConcurrentDictionary<String, IEventSubscription>, String, String, Object, String, CancellationToken)​

View Source​
Declaration
protected Task NotifyAsync(ConcurrentDictionary<string, IEventSubscription> map, string key, string selector, object message, string channel = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.Collections.Concurrent.ConcurrentDictionary<System.String,ServiceStack.IEventSubscription>map
System.Stringkey
System.Stringselector
System.Objectmessage
System.Stringchannel
System.Threading.CancellationTokentoken

FlushNopAsync(ConcurrentDictionary<String, ConcurrentDictionary<IEventSubscription, Boolean>>, String, String, CancellationToken)​

View Source​
Declaration
protected async Task FlushNopAsync(ConcurrentDictionary<string, ConcurrentDictionary<IEventSubscription, bool>> map, string key, string channel = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.Collections.Concurrent.ConcurrentDictionary<System.String,System.Collections.Concurrent.ConcurrentDictionary<ServiceStack.IEventSubscription,System.Boolean>>map
System.Stringkey
System.Stringchannel
System.Threading.CancellationTokentoken

Pulse(String)​

View Source​
Declaration
public bool Pulse(string id)
Returns​

System.Boolean

Parameters​
TypeName
System.Stringid

PulseAsync(String, CancellationToken)​

View Source​
Declaration
public async Task<bool> PulseAsync(string id, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<System.Boolean>

Parameters​
TypeName
System.Stringid
System.Threading.CancellationTokentoken

GetSubscription(String)​

View Source​
Declaration
public IEventSubscription GetSubscription(string id)
Returns​

ServiceStack.IEventSubscription

Parameters​
TypeName
System.Stringid

GetSubscriptionInfo(String)​

View Source​
Declaration
public SubscriptionInfo GetSubscriptionInfo(string id)
Returns​

ServiceStack.SubscriptionInfo

Parameters​
TypeName
System.Stringid

GetSubscriptionInfosByUserId(String)​

View Source​
Declaration
public List<SubscriptionInfo> GetSubscriptionInfosByUserId(string userId)
Returns​

System.Collections.Generic.List<ServiceStack.SubscriptionInfo>

Parameters​
TypeName
System.StringuserId

GetNextSequence(String)​

View Source​
Declaration
public long GetNextSequence(string sequenceId)
Returns​

System.Int64

Parameters​
TypeName
System.StringsequenceId

RemoveExpiredSubscriptions()​

View Source​
Declaration
public int RemoveExpiredSubscriptions()
Returns​

System.Int32

RemoveExpiredSubscriptionsAsync(CancellationToken)​

View Source​
Declaration
public async Task<int> RemoveExpiredSubscriptionsAsync(CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task<System.Int32>

Parameters​
TypeName
System.Threading.CancellationTokentoken

SubscribeToChannels(String, String[])​

View Source​
Declaration
public void SubscribeToChannels(string subscriptionId, string[] channels)
Parameters​
TypeName
System.StringsubscriptionId
System.String[]channels

SubscribeToChannelsAsync(String, String[], CancellationToken)​

View Source​
Declaration
public Task SubscribeToChannelsAsync(string subscriptionId, string[] channels, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.StringsubscriptionId
System.String[]channels
System.Threading.CancellationTokentoken

UnsubscribeFromChannels(String, String[])​

View Source​
Declaration
public void UnsubscribeFromChannels(string subscriptionId, string[] channels)
Parameters​
TypeName
System.StringsubscriptionId
System.String[]channels

UnsubscribeFromChannelsAsync(String, String[], CancellationToken)​

View Source​
Declaration
public Task UnsubscribeFromChannelsAsync(string subscriptionId, string[] channels, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.StringsubscriptionId
System.String[]channels
System.Threading.CancellationTokentoken

GetSubscriptionsDetails(String[])​

View Source​
Declaration
public List<Dictionary<string, string>> GetSubscriptionsDetails(params string[] channels)
Returns​

System.Collections.Generic.List<System.Collections.Generic.Dictionary<System.String,System.String>>

Parameters​
TypeName
System.String[]channels

GetAllSubscriptionsDetails()​

View Source​
Declaration
public List<Dictionary<string, string>> GetAllSubscriptionsDetails()
Returns​

System.Collections.Generic.List<System.Collections.Generic.Dictionary<System.String,System.String>>

GetAllSubscriptionInfos()​

View Source​
Declaration
public List<SubscriptionInfo> GetAllSubscriptionInfos()
Returns​

System.Collections.Generic.List<ServiceStack.SubscriptionInfo>

RegisterAsync(IEventSubscription, Dictionary<String, String>, CancellationToken)​

View Source​
Declaration
public async Task RegisterAsync(IEventSubscription subscription, Dictionary<string, string> connectArgs = null, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
ServiceStack.IEventSubscriptionsubscription
System.Collections.Generic.Dictionary<System.String,System.String>connectArgs
System.Threading.CancellationTokentoken

FlushNopToChannelsAsync(String[], CancellationToken)​

View Source​
Declaration
public async Task FlushNopToChannelsAsync(string[] channels, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.String[]channels
System.Threading.CancellationTokentoken

UnRegister(String, CancellationToken)​

View Source​
Declaration
public void UnRegister(string subscriptionId, CancellationToken token = default(CancellationToken))
Parameters​
TypeName
System.StringsubscriptionId
System.Threading.CancellationTokentoken

UnRegisterAsync(String, CancellationToken)​

View Source​
Declaration
public Task UnRegisterAsync(string subscriptionId, CancellationToken token = default(CancellationToken))
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.StringsubscriptionId
System.Threading.CancellationTokentoken

DisposeAsync()​

View Source​
Declaration
public async Task DisposeAsync()
Returns​

System.Threading.Tasks.Task

Dispose()​

View Source​
Declaration
public void Dispose()

Implements​