Documentation / @etherfold/js-processor / JSObjectEventProcessor
Class: JSObjectEventProcessor<ABI, ProcessResultType, ProcessorConfig>
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:43
Type Parameters
ABI
ABI extends Abi
ProcessResultType
ProcessResultType extends JSObject
ProcessorConfig
ProcessorConfig = undefined
Implements
EventProcessorWithInitialState<ABI,ProcessResultType,ProcessorConfig>
Constructors
Constructor
new JSObjectEventProcessor<
ABI,ProcessResultType,ProcessorConfig>(singleEventProcessor):JSObjectEventProcessor<ABI,ProcessResultType,ProcessorConfig>
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:55
Parameters
singleEventProcessor
SingleEventJSONProcessor<ABI, ProcessResultType, ProcessorConfig>
Returns
JSObjectEventProcessor<ABI, ProcessResultType, ProcessorConfig>
Properties
_json
protected_json:Partial<AllData<ABI,ProcessResultType, {history:HistoryJSObject; }>>
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:48
config
protectedconfig:ProcessorConfig|undefined
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:52
finality
protectedfinality:number|undefined
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:54
history
protectedhistory:History
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:49
keeper?
protectedoptionalkeeper?:KeepState<ABI,ProcessResultType, {history:HistoryJSObject; },ProcessorConfig>
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:50
source
protectedsource:IndexingSource<ABI> |undefined
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:51
version
protectedversion:string
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:53
Methods
clear()
clear():
Promise<void>
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:138
Returns
Promise<void>
Implementation of
EventProcessorWithInitialState.clear
configure()
configure(
config):void
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:109
Parameters
config
ProcessorConfig
Returns
void
Implementation of
EventProcessorWithInitialState.configure
copyFrom()
copyFrom(
otherProcessor):void
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:74
Parameters
otherProcessor
JSObjectEventProcessor<ABI, ProcessResultType, ProcessorConfig>
Returns
void
createInitialState()
createInitialState():
ProcessResultType
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:105
Returns
ProcessResultType
Implementation of
EventProcessorWithInitialState.createInitialState
getCodeFingerprint()
getCodeFingerprint():
string|undefined
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:101
Advisory; see EventProcessor.getCodeFingerprint. Delegated to the author's own object.
Returns
string | undefined
Implementation of
EventProcessorWithInitialState.getCodeFingerprint
getVersionHash()
getVersionHash():
string
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:96
Identity of the processor's LOGIC, which is what invalidates stored state.
There is no fallback constant anywhere in it, by construction. version is validated at construction, so the old ${version || 'unknown'} has nothing left to fall back to. The config half is now hashed the SAME way whether or not configure() was ever called, rather than substituting a 'not-configured' literal: an unconfigured processor and one configured with undefined are the same processor, and the old form gave them different hashes, discarding perfectly good state on the difference between a call that was made and a call that was not.
Returns
string
Implementation of
EventProcessorWithInitialState.getVersionHash
keepState()
keepState(
keeper):void
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:114
Parameters
keeper
KeepState<ABI, ProcessResultType, { history: HistoryJSObject; }, ProcessorConfig>
Returns
void
load()
load(
source,streamConfig):Promise<{lastSync:LastSync<ABI>;state:ProcessResultType; } |undefined>
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:149
Parameters
source
IndexingSource<ABI>
streamConfig
Returns
Promise<{ lastSync: LastSync<ABI>; state: ProcessResultType; } | undefined>
Implementation of
EventProcessorWithInitialState.load
process()
process(
eventStream,lastSync):Promise<ProcessResultType>
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:186
Parameters
eventStream
LogEvent<ABI>[]
lastSync
LastSync<ABI>
Returns
Promise<ProcessResultType>
Implementation of
EventProcessorWithInitialState.process
reset()
reset():
Promise<void>
Defined in: js-processor/src/processor/JSObjectEventProcessor.ts:118
Returns
Promise<void>
Implementation of
EventProcessorWithInitialState.reset