Class ActorAbstractMediaTyped<HI, HT, HO>Abstract

An abstract actor that handles media-typed actions.

It splits up a action between a 'handle' and a 'mediaTypes' action. A 'mediaTypes' action is used to retrieve the available media types from this actor. A 'handle' action is abstract, and can be implemented to do anything, such as parsing, serializing, etc.

See

  • IActionAbstractMediaTyped
  • ActorAbstractMediaTypedFixed

Type Parameters

  • HI
  • HT
  • HO

Hierarchy (view full)

Constructors

Properties

Actor that must be registered in the bus before this actor.

The bus this actor subscribes to.

name: string

The name for this actor.

Default

{<rdf:subject>}

Methods

  • Deinitialize this actor. This should be used for cleaning up things when the application is shut down, such as closing files and removing temporary files.

    Returns Promise<any>

    A promise that resolves when the actor has been deinitialized.

  • Initialize this actor. This should be used for doing things that take a while, such as opening files.

    Returns Promise<any>

    A promise that resolves when the actor has been initialized.

  • Check if this actor can run the given handle action, without actually running it.

    Parameters

    • action: HI

      The handle action to test.

    • mediaType: undefined | string

      The media type to test.

    • context: IActionContext

      An optional context.

    Returns Promise<HT>

    A promise that resolves to the handle test result.