29 lines
795 B
C#
29 lines
795 B
C#
using System;
|
|
using System.Threading;
|
|
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 Task<bool> RequestAsync(string targetPod, PodMessage message, CancellationToken cancellationToken = default)
|
|
=> Task.FromResult(false);
|
|
|
|
/// <inheritdoc />
|
|
public void Subscribe(Func<PodMessage, Task<bool>> handler)
|
|
{
|
|
}
|
|
}
|