Table of Contents

Class AsyncHandleable<T1, T2>

Namespace
Executables.Handling
Assembly
executables.dll

Base class for asynchronous handleables that support a single registered handler.

public abstract class AsyncHandleable<T1, T2> : IAsyncHandleable<T1, T2>, IAsyncHandleable<T1, T2, AsyncHandler<T1, T2>>

Type Parameters

T1

Type of the handler input.

T2

Type of the handler result.

Inheritance
AsyncHandleable<T1, T2>
Implements
Derived
Inherited Members

Properties

Handler

Currently registered handler, or null when no handler is registered.

protected AsyncHandler<T1, T2> Handler { get; }

Property Value

AsyncHandler<T1, T2>

Methods

Handle(AsyncHandler<T1, T2>)

Registers a handler.

public virtual IDisposable Handle(AsyncHandler<T1, T2> handler)

Parameters

handler AsyncHandler<T1, T2>

Handler to register.

Returns

IDisposable

Handle that unregisters the handler when disposed.

Exceptions

ArgumentNullException

handler is null.

InvalidOperationException

A handler is already registered.