Table of Contents

Class MessageDispatcher

Namespace
NuGet.Protocol.Plugins
Assembly
NuGet.Protocol.dll
public sealed class MessageDispatcher : IMessageDispatcher, IDisposable, IResponseHandler
Inheritance
MessageDispatcher
Implements
Inherited Members
Extension Methods

Constructors

MessageDispatcher(IRequestHandlers, IIdGenerator)

public MessageDispatcher(IRequestHandlers requestHandlers, IIdGenerator idGenerator)

Parameters

requestHandlers IRequestHandlers
idGenerator IIdGenerator

Properties

RequestHandlers

public IRequestHandlers RequestHandlers { get; }

Property Value

IRequestHandlers

Methods

Close()

public void Close()

CreateMessage(MessageType, MessageMethod)

public Message CreateMessage(MessageType type, MessageMethod method)

Parameters

type MessageType
method MessageMethod

Returns

Message

CreateMessage<TPayload>(MessageType, MessageMethod, TPayload)

public Message CreateMessage<TPayload>(MessageType type, MessageMethod method, TPayload payload) where TPayload : class

Parameters

type MessageType
method MessageMethod
payload TPayload

Returns

Message

Type Parameters

TPayload

DispatchCancelAsync(Message, CancellationToken)

public Task DispatchCancelAsync(Message request, CancellationToken cancellationToken)

Parameters

request Message
cancellationToken CancellationToken

Returns

Task

DispatchFaultAsync(Message, Fault, CancellationToken)

public Task DispatchFaultAsync(Message request, Fault fault, CancellationToken cancellationToken)

Parameters

request Message
fault Fault
cancellationToken CancellationToken

Returns

Task

DispatchProgressAsync(Message, Progress, CancellationToken)

public Task DispatchProgressAsync(Message request, Progress progress, CancellationToken cancellationToken)

Parameters

request Message
progress Progress
cancellationToken CancellationToken

Returns

Task

DispatchRequestAsync<TOutbound, TInbound>(MessageMethod, TOutbound, CancellationToken)

public Task<TInbound> DispatchRequestAsync<TOutbound, TInbound>(MessageMethod method, TOutbound payload, CancellationToken cancellationToken) where TOutbound : class where TInbound : class

Parameters

method MessageMethod
payload TOutbound
cancellationToken CancellationToken

Returns

Task<TInbound>

Type Parameters

TOutbound
TInbound

DispatchResponseAsync<TOutbound>(Message, TOutbound, CancellationToken)

public Task DispatchResponseAsync<TOutbound>(Message request, TOutbound responsePayload, CancellationToken cancellationToken) where TOutbound : class

Parameters

request Message
responsePayload TOutbound
cancellationToken CancellationToken

Returns

Task

Type Parameters

TOutbound

Dispose()

public void Dispose()

SetConnection(IConnection)

public void SetConnection(IConnection connection)

Parameters

connection IConnection