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.
36 lines
984 B
C#
36 lines
984 B
C#
using System;
|
|
using MediaBrowser.Model.Session;
|
|
|
|
namespace MediaBrowser.Controller.Session;
|
|
|
|
/// <summary>
|
|
/// A websocket message for a session held by another instance, carried as a <see cref="PodMessage"/>.
|
|
/// </summary>
|
|
public sealed class RoutedSessionMessage
|
|
{
|
|
/// <summary>
|
|
/// The <see cref="PodMessage.Kind"/> this payload travels under.
|
|
/// </summary>
|
|
public const string Kind = "SessionMessage";
|
|
|
|
/// <summary>
|
|
/// Gets or sets the session the message is addressed to.
|
|
/// </summary>
|
|
public string SessionId { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the message type.
|
|
/// </summary>
|
|
public SessionMessageType MessageType { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the message identifier.
|
|
/// </summary>
|
|
public Guid MessageId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the message data, serialized as JSON.
|
|
/// </summary>
|
|
public string Data { get; set; } = "null";
|
|
}
|