Skip to content
1 min read · 110 words

Type Alias: IsolatedImplementationFactory<S>

ts
type IsolatedImplementationFactory<S> = (input: {
  emit: IsolatedEmitter<S>;
  hostcall: (
    method: string,
    args: WireValue[],
    maxBytes?: number,
  ) => Promise<WireValue | string>;
}) => IsolatedImplementation<S>;

Defined in: src/batteries/isolation/serve.ts:51

The implementation factory serveIsolated/serveIsolatedOverPort calls once, up front, to obtain the guest-side method/stream implementations plus the emit capability for declared events.

Type Parameters

Type Parameter
S extends IsolatedServiceSpec

Parameters

ParameterTypeDescription
input{ emit: IsolatedEmitter<S>; hostcall: (method: string, args: WireValue[], maxBytes?: number) => Promise<WireValue | string>; }-
input.emitIsolatedEmitter<S>-
input.hostcall(method: string, args: WireValue[], maxBytes?: number) => Promise<WireValue | string>Issue a guest-to-host capability call.

Returns

IsolatedImplementation<S>