// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using Microsoft.AspNetCore.SignalR.Protocol; namespace Microsoft.AspNetCore.SignalR.Redis.Internal { public readonly struct RedisInvocation { /// /// Gets a list of connections that should be excluded from this invocation. /// May be null to indicate that no connections are to be excluded. /// public IReadOnlyList ExcludedConnectionIds { get; } /// /// Gets the message serialization cache containing serialized payloads for the message. /// public SerializedHubMessage Message { get; } public RedisInvocation(SerializedHubMessage message, IReadOnlyList excludedConnectionIds) { Message = message; ExcludedConnectionIds = excludedConnectionIds; } public static RedisInvocation Create(string target, object[] arguments, IReadOnlyList excludedConnectionIds = null) { return new RedisInvocation( new SerializedHubMessage(new InvocationMessage(target, null, arguments)), excludedConnectionIds); } } }