Options
All
  • Public
  • Public/Protected
  • All
Menu

A base actor for dereferencing URLs to rule streams.

Actor types:

  • Input: IActionDereferenceRule: A URL.
  • Test:
  • Output: IActorDereferenceRuleOutput: A rule stream.
see

IActionDereferenceRule

see

IActorDereferenceRuleOutput

Hierarchy

Index

Constructors

constructor

Properties

Readonly beforeActors

beforeActors: Actor<IActionDereferenceParse<IActionRuleParseMetadata>, IActorTest, IActorDereferenceParseOutput<RuleStream, undefined>>[]

Readonly bus

bus: Bus<Actor<IActionDereferenceParse<IActionRuleParseMetadata>, IActorTest, IActorDereferenceParseOutput<RuleStream, undefined>>, IActionDereferenceParse<IActionRuleParseMetadata>, IActorTest, IActorDereferenceParseOutput<RuleStream, undefined>>

Readonly mediaMappings

mediaMappings: Record<string, string>

Readonly mediatorDereference

mediatorDereference: MediatorDereference

Readonly mediatorParse

mediatorParse: MediateMediaTyped<IActionParse<IActionRuleParseMetadata>, IActorTest, IActorParseOutput<RuleStream, undefined>>

Readonly mediatorParseMediatypes

mediatorParseMediatypes: MediateMediaTypes

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 dereferenceErrorHandler

  • dereferenceErrorHandler<N, M>(action: IActionDereferenceParse<IActionRuleParseMetadata>, error: unknown, output: N): Promise<N & { data: M }>
  • Handle the given error as a rejection or delegate it to the logger, depending on whether or not hard errors are enabled.

    Type parameters

    • N

    • M: Readable<M>

    Parameters

    • action: IActionDereferenceParse<IActionRuleParseMetadata>

      An action.

    • error: unknown

      An error that has occurred.

    • output: N

      Data to add to the output

    Returns Promise<N & { data: M }>

Protected getDefaultLogData

  • getDefaultLogData(context: IActionContext, data?: () => any): any
  • Parameters

    • context: IActionContext
    • Optional data: () => any
        • (): any
        • Returns any

    Returns any

Abstract getMetadata

  • Parameters

    • dereference: IActorDereferenceOutput

    Returns Promise<undefined | IActionRuleParseMetadata>

Protected handleDereferenceStreamErrors

  • handleDereferenceStreamErrors<L, T>(action: IActionDereferenceParse<L>, data: T): T
  • If hard errors are disabled, modify the given stream so that errors are delegated to the logger.

    Type parameters

    • L: IParseMetadata

    • T: Readable<T>

    Parameters

    • action: IActionDereferenceParse<L>

      A dereference action.

    • data: T

      A data stream.

    Returns T

    The resulting data stream.

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: IActionContext, message: string, data?: () => any): void
  • Parameters

    • context: IActionContext
    • message: string
    • Optional data: () => any
        • (): any
        • Returns any

    Returns void

Protected logError

  • logError(context: IActionContext, message: string, data?: () => any): void
  • Parameters

    • context: IActionContext
    • message: string
    • Optional data: () => any
        • (): any
        • Returns any

    Returns void

Protected logFatal

  • logFatal(context: IActionContext, message: string, data?: () => any): void
  • Parameters

    • context: IActionContext
    • message: string
    • Optional data: () => any
        • (): any
        • Returns any

    Returns void

Protected logInfo

  • logInfo(context: IActionContext, message: string, data?: () => any): void
  • Parameters

    • context: IActionContext
    • message: string
    • Optional data: () => any
        • (): any
        • Returns any

    Returns void

Protected logTrace

  • logTrace(context: IActionContext, message: string, data?: () => any): void
  • Parameters

    • context: IActionContext
    • message: string
    • Optional data: () => any
        • (): any
        • Returns any

    Returns void

Protected logWarn

  • logWarn(context: IActionContext, message: string, data?: () => any): void
  • Parameters

    • context: IActionContext
    • message: string
    • Optional data: () => any
        • (): any
        • Returns any

    Returns void

run

  • Parameters

    Returns Promise<IActorDereferenceParseOutput<RuleStream, undefined>>

runObservable

  • Run the given action on this actor AND invokes the {@link Bus#onRun} method.

    Parameters

    Returns Promise<IActorDereferenceParseOutput<RuleStream, undefined>>

    A promise that resolves to the run result.

test

  • test(action: IActionDereference): Promise<IActorTest>
  • Parameters

    • action: IActionDereference

    Returns Promise<IActorTest>

Static getContextLogger

  • getContextLogger(context: IActionContext): undefined | Logger
  • Get the logger from the given context.

    Parameters

    • context: IActionContext

      An optional context.

    Returns undefined | Logger

    The logger or undefined.

Generated using TypeDoc