public async Task NotifyAllUsersFromAnotherHubAsync()
        {
            // Get all users from AnotherHub, and send them message.
            var allUsers = await _userPartitioner.GetAllClientSetIdsAsync(_clusterClient, typeof(AnotherHub).GUID);

            await Clients.Users(allUsers.ToList()).SendAsync("OnReceived", new object[] { "Hello, user!" });
        }
        public async Task NotifyClientsAllUsersAsync()
        {
            // Get all user ids, but this time from AnotherSampleHub,
            var allUserIds = await _userPartitioner.GetAllClientSetIdsAsync(GrainFactory, HubTypeIds.AnotherSampleHub);

            // and send all clients message.
            var tasks = allUserIds.Select(id => GrainFactory.GetUser(id, HubTypeIds.AnotherSampleHub).SendClientSetAsync("OnReveive", new object[] { "Hello, user!" }));
            await Task.WhenAll(tasks);
        }
        public async Task SaveSnapshotAllGroupsAsync()
        {
            // Get all group names,
            var allGroupNames = await _groupPartitioner.GetAllClientSetIdsAsync(GrainFactory, HubTypeIds.SampleHub);

            // save with timestamp.
            State.AllGroups = new List <string>(allGroupNames);
            State.Timestamp = DateTime.UtcNow;
            await WriteStateAsync();
        }
 public async Task <IEnumerable <string> > GetAllGroupsAsync()
 {
     return(await _groupPartitioner.GetAllClientSetIdsAsync(_clusterClient, typeof(SampleHub).GUID));
 }