Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Conversation

@mikaelm12
Copy link
Contributor

This is in preparation for OthersInGroup. GroupExcept is analogous to AllExcept so that we can make OthersInGroup work similarly to Others
Still working on this but was looking for early feedback. Hanging some tests btw... any insight there would be appreciated.
Haven't added new tests for this feature yet as well.

Copy link
Contributor

@analogrelay analogrelay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me so far.

throw new ArgumentNullException(nameof(groupName));
}

var message = new RedisExcludeClientsMessage(GetInvocationId(), nonBlocking: true, target: methodName, excludedIds: excludedIds, arguments: args);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this. It uses an existing message and we just publish it to a different Redis key. 👍

@analogrelay
Copy link
Contributor

Hanging some tests btw... any insight there would be appreciated

Story of my week ;). We need to get a handle on hanging and flaky tests. There are a couple of options to help diagnose them. Once #1147 is merged we'll get long-running test notifications which will tell you which tests are still running after 5 seconds.

@mikaelm12 mikaelm12 force-pushed the mikaelm12/GroupExcept branch from 2193580 to f803e6d Compare December 14, 2017 01:43
@mikaelm12
Copy link
Contributor Author

Fixed the hang so I need to add test now 😄

var tasks = group.Values.Where(connection => !excludedIds.Contains(connection.ConnectionId))
.Select(c => c.WriteAsync(message));
return Task.WhenAll(tasks);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a reasonable place to add logging or should we first finalize our logging strategy? @BrennanConroy @anurse

@mikaelm12 mikaelm12 changed the title [WIP] AllExcept for Groups - GroupExcept AllExcept for Groups - GroupExcept Dec 14, 2017
@davidfowl
Copy link
Member

I have a growing concern that we should look at addressing and it's about the explosion of methods on the HubLifetimeManager as a result of these slices of connections. I want us to investigate a named filter concept to see if we can avoid some of the explosion.

@analogrelay
Copy link
Contributor

@davidfowl I had the same thoughts. I think we can get away with a single Group primitive and write the others like that (including All).

@mikaelm12 mikaelm12 force-pushed the mikaelm12/GroupExcept branch from ca7c7d6 to e87c987 Compare December 14, 2017 18:53
{
private readonly string _groupName;
private readonly HubLifetimeManager<THub> _lifetimeManager;
private IReadOnlyList<string> _excludedIds;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readonly

await manager.AddGroupAsync(connection1.ConnectionId, "gunit").OrTimeout();
await manager.AddGroupAsync(connection2.ConnectionId, "gunit").OrTimeout();

var excludedIds = new List<string>{client2.Connection.ConnectionId };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space after {


await connection1.DisposeAsync().OrTimeout();
await connection2.DisposeAsync().OrTimeout();
Assert.Null(client2.TryRead());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do this before disposing

@mikaelm12 mikaelm12 merged commit eb2668e into dev Dec 16, 2017
@BrennanConroy BrennanConroy deleted the mikaelm12/GroupExcept branch August 6, 2018 19:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants