Skip to content

CancellationToken on typed hub client methods (SignalR request) #8813

@kierenj

Description

@kierenj

I'm looking to have a loop which reads work from a Channel and writes to clients via typed hub methods.

I'll be doing something like the following on a long-running task:

while (!cancel.IsCancellationRequested)
{
  var signal = await _channel.ReadAsync(cancel);
  await _context.Clients.Groups(groupNames).ProcessSignal(signal); // can't pass "cancel" here
}

I'm not sure of the range of time/effort a hub client call might take: would it make sense to support a CancellationToken argument on typed client hub calls?

(Background: #8346 (comment))

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-signalrIncludes: SignalR clients and serversenhancementThis issue represents an ask for new feature or an enhancement to an existing onehelp wantedUp for grabs. We would accept a PR to help resolve this issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions