Files
jellyfin-ha-src/MediaBrowser.Controller/Session/IPodMessageBus.cs
T
unkin-agent 00d0765152
ci/woodpecker/pr/ci Pipeline failed
ci/woodpecker/push/ci Pipeline failed
feat(session): share the session directory between instances
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.
2026-09-24 22:48:48 +10:00

30 lines
948 B
C#

using System;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Session;
/// <summary>
/// Point-to-point delivery between instances: every instance listens on a channel of its own, so a
/// message can be addressed to the one instance holding a given connection.
/// </summary>
public interface IPodMessageBus
{
/// <summary>
/// Gets the identity of this instance.
/// </summary>
string PodId { get; }
/// <summary>
/// Sends a message to one instance. Delivery is best effort and never throws.
/// </summary>
/// <param name="targetPod">The instance to deliver to.</param>
/// <param name="message">The message.</param>
void Publish(string targetPod, PodMessage message);
/// <summary>
/// Registers a handler for the messages addressed to this instance.
/// </summary>
/// <param name="handler">The handler.</param>
void Subscribe(Func<PodMessage, Task> handler);
}