A client side Comm interface.

interface IComm {
    commId: string;
    isDisposed: boolean;
    onClose: ((msg) => void | PromiseLike<void>);
    onMsg: ((msg) => void | PromiseLike<void>);
    targetName: string;
    close(data?, metadata?, buffers?): IShellFuture<IShellMessage<ShellMessageType>, IShellMessage<ShellMessageType>>;
    dispose(): void;
    open(data?, metadata?, buffers?): IShellFuture<IShellMessage<ShellMessageType>, IShellMessage<ShellMessageType>>;
    send(data, metadata?, buffers?, disposeOnDone?): IShellFuture<IShellMessage<ShellMessageType>, IShellMessage<ShellMessageType>>;
}

Hierarchy

Properties

commId: string

The unique id for the comm channel.

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

onClose: ((msg) => void | PromiseLike<void>)

Callback for a comm close event.

Notes

This is called when the comm is closed from either the server or client. If this is called in response to a kernel message and the handler returns a promise, all kernel message processing pauses until the promise is resolved.

Type declaration

    • (msg): void | PromiseLike<void>
    • Parameters

      Returns void | PromiseLike<void>

onMsg: ((msg) => void | PromiseLike<void>)

Callback for a comm message received event.

Notes

If the handler returns a promise, all kernel message processing pauses until the promise is resolved.

Type declaration

    • (msg): void | PromiseLike<void>
    • Parameters

      Returns void | PromiseLike<void>

targetName: string

The target name for the comm channel.

Methods

  • Dispose of the resources held by the object.

    Notes

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    Undefined Behavior

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void