Example #1
0
 private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
 {
     if (e.Type == SqlNotificationType.Change)
     {
         UsersHub.SendUsers();
     }
 }
Example #2
0
        private void AddAgentOfflineInspector()
        {
            var inspector = UsersHub.GetUserOfflineInspector(ClientTenantId, ClientUserId);

            inspector.Task.ContinueWith(task =>
            {
                if (!task.Result)
                {
                    return;
                }
                Status(2);
            });

            agentOfflineInspectors.AddOrUpdate(ClientUserId, inspector,
                                               (user, oldInspector) =>
            {
                oldInspector.CancellationTokenSource.Cancel();
                return(inspector);
            });

            inspector.Task.Start();
        }