Skip to content

Support strongly typed Hub ClientsΒ #131

@lfshr

Description

@lfshr

The Hub class allows for the use of strongly typed Hub clients. It would be great if the Azure SignalR service could also support the same! eg.

public interface IChatClient
{
    Task ReceiveMessage(string message);
}

public class ClientHub : ServerlessHub<IChatClient>
{
    ...

    [FunctionName(nameof(SendClientMessage))]
    public async Task SendClientMessage([SignalRTrigger] InvocationContext invocationContext, ILogger logger)
    {
        await Clients.All.ReceiveMessage("Hello World!");
    }
}

https://docs.microsoft.com/en-us/aspnet/core/signalr/hubs?view=aspnetcore-3.1#strongly-typed-hubs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions