Skip to main content
Version: 0.17

Interface: RequestStrategyOptions

Hierarchy​

Properties​

action​

• action: string | (...args: unknown[]) => unknown

The action to perform on the target.

Can be specified as a string (e.g. pull) or a function which will be invoked in the context of this strategy (and thus will have access to both this.source and this.target).

Inherited from​

ConnectionStrategyOptions.action

Defined in​

strategies/connection-strategy.ts:31


blocking​

• Optional blocking: boolean | (...args: unknown[]) => boolean

Should resolution of action on the the target block the completion of the source's event?

By default, blocking is false.

Inherited from​

ConnectionStrategyOptions.blocking

Defined in​

strategies/connection-strategy.ts:52


logLevel​

• Optional logLevel: LogLevel

A specific log level for this strategy.

Overrides the log level used when activating the coordinator.

Inherited from​

ConnectionStrategyOptions.logLevel

Defined in​

strategy.ts:33


logPrefix​

• Optional logPrefix: string

The prefix to use for logging from this strategy.

Defaults to [${name}].

Inherited from​

ConnectionStrategyOptions.logPrefix

Defined in​

strategy.ts:26


name​

• Optional name: string

Name of strategy.

Used to uniquely identify this strategy in a coordinator's collection.

Inherited from​

ConnectionStrategyOptions.name

Defined in​

strategy.ts:13


on​

• on: string

The name of the event to observe.

Inherited from​

ConnectionStrategyOptions.on

Defined in​

strategies/connection-strategy.ts:17


passHints​

• Optional passHints: boolean

Should results returned from calling action on the target source be passed as hint data back to the source?

This can allow hints to inform the processing of subsequent actions on the source. For instance, a beforeQuery event might invoke query on a target, and those results could inform how the originating source performs _query. This might allow a target source's sorting and filtering of results to affect how the originating source processes the query.

This setting is only effective for blocking strategies, since only in those scenarios is processing delayed.

Defined in​

strategies/request-strategy.ts:29


source​

• source: string

The name of the source to be observed.

Inherited from​

ConnectionStrategyOptions.source

Defined in​

strategies/connection-strategy.ts:12


sources​

• Optional sources: string[]

The names of sources to include in this strategy. Leave undefined to include all sources registered with a coordinator.

Inherited from​

ConnectionStrategyOptions.sources

Defined in​

strategy.ts:19


target​

• Optional target: string

The name of the source which will be acted upon.

Inherited from​

ConnectionStrategyOptions.target

Defined in​

strategies/connection-strategy.ts:22

Methods​

catch​

â–¸ Optional catch(error, ...args): void

A handler for any errors thrown as a result of performing the action.

Parameters​

NameType
errorError
...argsunknown[]

Returns​

void

Inherited from​

ConnectionStrategyOptions.catch

Defined in​

strategies/connection-strategy.ts:36


filter​

â–¸ Optional filter(...args): boolean

A filter function that returns true if the action should be performed.

filter will be invoked in the context of this strategy (and thus will have access to both this.source and this.target).

Parameters​

NameType
...argsunknown[]

Returns​

boolean

Inherited from​

ConnectionStrategyOptions.filter

Defined in​

strategies/connection-strategy.ts:44