Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ActorHttp

A base actor for listening to HTTP events.

Actor types:

  • Input: IActionHttp: The HTTP request.
  • Test: IActorHttpTest: An estimate for the response time.
  • Output: IActorHttpOutput: The HTTP response.
see

IActionHttp

see

IActorHttpTest

see

IActorHttpOutput

Hierarchy

Implements

Index

Constructors

constructor

Properties

Readonly beforeActors

Readonly bus

Readonly name

name: string

Methods

deinitialize

  • deinitialize(): Promise<any>
  • 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.

Protected getDefaultLogData

  • getDefaultLogData(context: ActionContext | undefined, data?: undefined | (() => any)): any

initialize

  • initialize(): Promise<any>
  • 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.

Protected logDebug

  • logDebug(context: ActionContext | undefined, message: string, data?: undefined | (() => any)): void

Protected logError

  • logError(context: ActionContext | undefined, message: string, data?: undefined | (() => any)): void

Protected logFatal

  • logFatal(context: ActionContext | undefined, message: string, data?: undefined | (() => any)): void

Protected logInfo

  • logInfo(context: ActionContext | undefined, message: string, data?: undefined | (() => any)): void

Protected logTrace

  • logTrace(context: ActionContext | undefined, message: string, data?: undefined | (() => any)): void

Protected logWarn

  • logWarn(context: ActionContext | undefined, message: string, data?: undefined | (() => any)): void

Abstract run

  • Run the given action on this actor.

    In most cases, this method should not be called directly. Instead, {@link #runObservable} should be called.

    Parameters

    Returns Promise<IActorHttpOutput>

    A promise that resolves to the run result.

runObservable

Abstract test

Static getContextLogger

Static headersToHash

  • headersToHash(headers: Headers): Record<string, string>

Static toNodeReadable

  • toNodeReadable(body: ReadableStream | null): ReadableStream
  • Converts a WhatWG streams to Node streams if required. Returns the input in case the stream already is a Node stream.

    Parameters

    • body: ReadableStream | null

    Returns ReadableStream

Generated using TypeDoc