コード例 #1
0
        /// <inheritdoc />
        public PayloadInterceptMessageSendService(IPayloadInterceptable interceptionService, IPeerPayloadSendService <TPayloadBaseType> sendService)
        {
            if (interceptionService == null)
            {
                throw new ArgumentNullException(nameof(interceptionService));
            }
            if (sendService == null)
            {
                throw new ArgumentNullException(nameof(sendService));
            }

            InterceptionService = interceptionService;
            SendService         = sendService;
        }
コード例 #2
0
 //TODO: Add cancellation token support
 /// <summary>
 /// Registers an interception request that yields an awaitable for
 /// the specified <typeparamref name="TResponseType"/> type.
 /// </summary>
 /// <typeparam name="TResponseType">The payload type to intercept.</typeparam>
 /// <returns>An awaitable for the next recieved payload of the speified type.</returns>
 public static Task <TResponseType> InterceptPayload <TResponseType>(this IPayloadInterceptable interceptable)
 {
     return(interceptable.InterceptPayload <TResponseType>(CancellationToken.None));
 }