00d0765152
Publish every session to valkey with the instance holding it, and route a command for a non-local session to its owner over a per-instance pub/sub channel. Entries expire, so a dead instance leaves the directory.
29 lines
684 B
C#
29 lines
684 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MediaBrowser.Controller.Session;
|
|
|
|
/// <summary>
|
|
/// The single-instance <see cref="IPodMessageBus"/>: there is no other instance to reach.
|
|
/// </summary>
|
|
public sealed class NullPodMessageBus : IPodMessageBus
|
|
{
|
|
/// <summary>
|
|
/// Gets the shared instance.
|
|
/// </summary>
|
|
public static NullPodMessageBus Instance { get; } = new NullPodMessageBus();
|
|
|
|
/// <inheritdoc />
|
|
public string PodId => PodIdentity.Current;
|
|
|
|
/// <inheritdoc />
|
|
public void Publish(string targetPod, PodMessage message)
|
|
{
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public void Subscribe(Func<PodMessage, Task> handler)
|
|
{
|
|
}
|
|
}
|