Sidub.Messaging.Host.SignalR 1.0.8

Prefix Reserved
dotnet add package Sidub.Messaging.Host.SignalR --version 1.0.8                
NuGet\Install-Package Sidub.Messaging.Host.SignalR -Version 1.0.8                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sidub.Messaging.Host.SignalR" Version="1.0.8" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sidub.Messaging.Host.SignalR --version 1.0.8                
#r "nuget: Sidub.Messaging.Host.SignalR, 1.0.8"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Sidub.Messaging.Host.SignalR as a Cake Addin
#addin nuget:?package=Sidub.Messaging.Host.SignalR&version=1.0.8

// Install Sidub.Messaging.Host.SignalR as a Cake Tool
#tool nuget:?package=Sidub.Messaging.Host.SignalR&version=1.0.8                

Sidub Messaging - Messaging SignalR Host

This repository contains the messaging SignalR host for Sidub Messaging. It provides functionality to facilitate the messaging implementation on an Azure serverless SignalR service.

Azure serverless SignalR consists of an isolated Azure Function and an Azure SignalR service in serverless mode. The Azure Function is responsible for negotiation between clients and defining the messaging hubs, while the Azure SignalR service is responsible for managing the connections and broadcasting messages.

This package supports the creation of the creation of messaging hubs within the isolated Azure Function.

Main Concepts

Infrastructure

The Azure SignalR messaging service is dependent upon Azure infrastructure; while infrastructure may be manually created, it is recommended to use the provided Sidub Messaging application available on the Azure Marketplace. By deploying this application, the necessary Azure SignalR, Function, Storage, and other resources will be created automatically.

See https://azuremarketplace.microsoft.com/ for more information.

Function initialization

In order to utilize the library functionality, we must register the required services within the Azure Function. This is done by calling the AddSidubSignalRServer method on the IFunctionsWorkerApplicationBuilder object.

We must additionally configure the required options classes, such as the MessageServerOptions and AuthenticationOptions classes. These classes contain the necessary configuration for the messaging service and the authentication service, respectively.

var host = new HostBuilder()
    .ConfigureFunctionsWorkerDefaults((context, builder) =>
    {

        builder.Services.Configure<MessageServerOptions>(context.Configuration.GetSection(nameof(MessageServerOptions)));
        builder.AddSidubSignalRServer();

    })
    .ConfigureServices((context, services) =>
    {
        services.Configure<AuthenticationOptions>(context.Configuration.GetSection(nameof(AuthenticationOptions)));
        services.AddApplicationInsightsTelemetryWorkerService();
        services.ConfigureFunctionsApplicationInsights();
    })
    .Build();

host.Run();

Messaging hub

A messaging hub is a C# class that defines a messaging endpoint. Multiple endpoints can be defined within a single Azure Function.

To define a messaging hub, simply inherit from the MessagingHub class and decorate the class with the MessagingHubAttribute attribute. The attribute requires a unique name for the hub.

[MessagingHub("Chatroom")]
public class ChatroomHub : MessagingHub
{

    public ChatroomHub(IOptionsSnapshot<MessageServerOptions> options, IMessagingHubConnectionStore connectionStore, ILoggerFactory loggerFactory)
        : base(options, connectionStore, loggerFactory)
    {

    }

}

License

This project is licensed under a proprietary license. For details, see https://sidub.ca/licensing or the LICENSE.txt file.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.8 93 10/2/2024