Ejemplo n.º 1
0
 public ContestUpdateFactory(
     IContestStore contestStore,
     IConnectedClientStore connectedClients)
 {
     _contestStore     = contestStore;
     _connectedClients = connectedClients;
 }
Ejemplo n.º 2
0
 public UpdateFactory(
     TypingDuelsState state,
     IConnectedClientStore connectedClients)
 {
     _state            = state;
     _connectedClients = connectedClients;
 }
Ejemplo n.º 3
0
 public UpdateFactory(
     IPlayerRepository playerRepository,
     IConnectedClientStore connectedClients)
 {
     _playerRepository = playerRepository;
     _connectedClients = connectedClients;
 }
Ejemplo n.º 4
0
 public PlayerPersistenceFactory(
     ILocationStore locationStore,
     IRoadStore roadStore,
     IConnectedClientStore connectedClientStore)
 {
     _locationStore        = locationStore;
     _roadStore            = roadStore;
     _connectedClientStore = connectedClientStore;
 }
Ejemplo n.º 5
0
 public TypeMessageHandler(
     TypingDuelsState state,
     IConnectedClientStore connectedClients,
     TypedDebouncer debouncer)
 {
     _state            = state;
     _connectedClients = connectedClients;
     _debouncer        = debouncer;
 }
Ejemplo n.º 6
0
 public ConnectionHandler(
     ILogger <ConnectionHandler> logger,
     IConnectionInitializer connectionInitializer,
     IConnectedClientStore connectedClients,
     IMessageDispatcher messageDispatcher,
     IUpdateDetector updateDetector,
     IUpdater updater)
 {
     _logger = logger;
     _connectionInitializer = connectionInitializer;
     _connectedClients      = connectedClients;
     _messageDispatcher     = messageDispatcher;
     _updateDetector        = updateDetector;
     _updater = updater;
 }
Ejemplo n.º 7
0
 public ConnectionHandler(
     ILogger <ConnectionHandler> logger,
     IConnectionInitializer connectionInitializer,
     IConnectedClientStore connectedClients,
     IMessageDispatcher messageDispatcher,
     IQueryDispatcher queryDispatcher,
     IUpdateDetector updateDetector,
     IMessageTypeCache messageTypeCache,
     IEnumerable <IConnectedClientInitializer> connectedClientInitializers,
     IUpdater updater)
 {
     _logger = logger;
     _connectionInitializer       = connectionInitializer;
     _connectedClients            = connectedClients;
     _messageDispatcher           = messageDispatcher;
     _queryDispatcher             = queryDispatcher;
     _updateDetector              = updateDetector;
     _messageTypeCache            = messageTypeCache;
     _connectedClientInitializers = connectedClientInitializers;
     _updater = updater;
 }
Ejemplo n.º 8
0
 public DisconnectHandler(IConnectedClientStore store)
 {
     _store = store;
 }
 public BroadcastMessageHandler(IConnectedClientStore connectedClients)
 {
     _connectedClients = connectedClients;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Sends message to all the clients in specified list of groups.
 /// </summary>
 /// <param name="store">ConnectedClientStore instance.</param>
 /// <param name="message">Message to send to all the clients in given group.</param>
 /// <param name="groups">The list of groups to which the message will be sent.</param>
 /// <param name="cancellationToken">Cancellation token.</param>
 /// <returns></returns>
 public static ValueTask SendAsync(this IConnectedClientStore store, object message, IEnumerable <string> groups, CancellationToken cancellationToken)
 => AsyncHelpers.WhenAll(store.FindInGroups(groups)
                         .Select(x => x.Connection.SendAsync(message, cancellationToken)));
Ejemplo n.º 11
0
 /// <summary>
 /// Finds all clients that are in given messaging group.
 /// </summary>
 /// <param name="store">ConnectedClientStore instance.</param>
 /// <param name="groups">Collection of messaging groups to search for.</param>
 /// <returns>Collection of clients that are present in requested group.</returns>
 public static IEnumerable <ConnectedClient> FindInGroups(this IConnectedClientStore store, params string[] groups)
 => store.FindInGroups(groups);
Ejemplo n.º 12
0
 /// <summary>
 /// Gets a value indicating whether given client is present in the store
 /// (if it's connected - it will be present in the store).
 /// </summary>
 /// <param name="store">ConnectedClientStore instance.</param>
 /// <param name="clientId">Connected client identity.</param>
 /// <returns>A value indicating whether given client is present in the store.</returns>
 public static bool IsClientConnected(this IConnectedClientStore store, string clientId)
 => store.Find(clientId) != null;
Ejemplo n.º 13
0
 public AnnounceHandler(IConnectedClientStore connectedClients)
 {
     _connectedClients = connectedClients;
 }