Exemplo n.º 1
0
 private void TrackConnection(HTTPSourcedAction a)
 {
     _ConnectionAreas = _ConnectionAreas ?? new Dictionary <string, List <MicroServices.Area> >();
     // Add the connection to the dict if not there
     if (!_ConnectionAreas.ContainsKey(a.ConnectionId))
     {
         _ConnectionAreas.Add(a.ConnectionId, new List <MicroServices.Area>());
     }
     // Add the area and add the user to the signal r group if not there
     if (!_ConnectionAreas[a.ConnectionId].Contains(MicroServices.Area.Client))
     {
         Logger.Debug($"Adding user '{a.User}' to group '{Area.ToString()}'");
         _ConnectionAreas[a.ConnectionId].Add(Area);
         HTTPExternalInterface.JoinGroup(Area.ToString(), a.ConnectionId);
     }
 }
Exemplo n.º 2
0
        // - Actions are abstract
        // - Commands is a kind of Action
        // - Requests is a kind of Action

        public HTTPDestinedStateEvent(MicroServices.ProcessingStatus status, string message, HTTPSourcedAction originalAction)
        {
            ConnectionId = originalAction.ConnectionId;
            Action       = originalAction.Action;
            User         = originalAction.User;
            Area         = originalAction.Area;
            Message      = message;
            Status       = status;
        }