import { FExecutionContext } from "../execution_context/index.js"; /** * FChannelEvent provides a channel to handle events asynchronously. * * This is very similar to FChannelSubscriber but callback signature * does not accept Exception. * In another words: FChannelEvent is unbreakable channel version of FChannelSubscriber. */ export interface FChannelEvent = FChannelEvent.Event> { addHandler(cb: FChannelEvent.Callback): void; removeHandler(cb: FChannelEvent.Callback): void; } export namespace FChannelEvent { export interface Event { readonly data: TData; } export interface Callback = Event> { (executionContext: FExecutionContext, event: TEvent): Promise; } }