Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IFuture

A Future interface for responses from the kernel.

When a message is sent to a kernel, a Future is created to handle any responses that may come from the kernel.

Hierarchy

  • Disposable
    • IFuture

Index

Properties

Readonly done

done: Thenable<IShellMessage>

A Thenable that resolves when the future is done.

Notes

The future is done when there are no more responses expected from the kernel.

The done Thenable resolves to the reply message if there is one, otherwise it resolves to undefined.

Readonly msg

The original outgoing message.

Methods

dispose

  • dispose(): any
  • Dispose this object.

    Returns any

registerMessageHook

  • registerMessageHook(hook: (msg: IIOPubMessage) => boolean | Thenable<boolean>): void
  • Register hook for IOPub messages.

    Parameters

    • hook: (msg: IIOPubMessage) => boolean | Thenable<boolean>

      The callback invoked for an IOPub message.

      Notes

      The IOPub hook system allows you to preempt the handlers for IOPub messages handled by the future.

      The most recently registered hook is run first. A hook can return a boolean or a Thenable to a boolean, in which case all kernel message processing pauses until the Thenable is fulfilled. If a hook return value resolves to false, any later hooks will not run and the function will return a Thenable resolving to false. If a hook throws an error, the error is logged to the console and the next hook is run. If a hook is registered during the hook processing, it will not run until the next message. If a hook is removed during the hook processing, it will be deactivated immediately.

    Returns void

removeMessageHook

  • removeMessageHook(hook: (msg: IIOPubMessage) => boolean | Thenable<boolean>): void
  • Remove a hook for IOPub messages.

    Parameters

    • hook: (msg: IIOPubMessage) => boolean | Thenable<boolean>

      The hook to remove.

      Notes

      If a hook is removed during the hook processing, it will be deactivated immediately.

    Returns void

sendInputReply

  • Send an input_reply message.

    Parameters

    Returns void

setIOPubHandler

  • Sets the iopub handler for the kernel future.

    Notes

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

    Parameters

    Returns void

setReplyHandler

  • Set the reply handler for the kernel future.

    Notes

    If the handler returns a Thenable, all kernel message processing pauses until the Thenable is resolved. If there is a reply message, the future done Thenable also resolves to the reply message after this handler has been called.

    Parameters

    Returns void

setStdInHandler

  • Sets the stdin handler for the kernel future.

    Notes

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

    Parameters

    Returns void

Generated using TypeDoc