routier-collection / plugins/replication/src / PluginSyncEngineOptions
Type Alias: PluginSyncEngineOptions
PluginSyncEngineOptions =
object
Defined in: plugins/replication/src/PluginSyncEngine.ts:26
Properties
source
source:
IDbPlugin
Defined in: plugins/replication/src/PluginSyncEngine.ts:28
Primary read/write plugin.
queryPlugins?
optionalqueryPlugins:IDbPlugin[]
Defined in: plugins/replication/src/PluginSyncEngine.ts:34
Optional ordered list of plugins to try for reads. If omitted, reads use source.
Default
[source]mirrorPlugins?
optionalmirrorPlugins:IDbPlugin[]
Defined in: plugins/replication/src/PluginSyncEngine.ts:40
Plugins that should receive mirrored writes after source succeeds. Typical use: write-through from local store to remote sync plugin.
Default
[]persistAckMode?
optionalpersistAckMode:PersistAckMode
Defined in: plugins/replication/src/PluginSyncEngine.ts:47
Whether to report success to caller after source only, or after all mirrors settle.
- after-source: low-latency optimistic ack.
- after-all: transactional-style ack across composition.
Default
"after-source"mirrorFailureMode?
optionalmirrorFailureMode:MirrorFailureMode
Defined in: plugins/replication/src/PluginSyncEngine.ts:54
How mirror failures are handled.
- swallow: keep success from source and emit hook/log.
- surface: fail operation (only meaningful with ackMode=after-all).
Default
"swallow"queryFailureMode?
optionalqueryFailureMode:QueryFailureMode
Defined in: plugins/replication/src/PluginSyncEngine.ts:59
When all query routes fail, choose which error to surface.
Default
"surface-last"destroyFailureMode?
optionaldestroyFailureMode:DestroyFailureMode
Defined in: plugins/replication/src/PluginSyncEngine.ts:64
Destroy error policy across composed plugins.
Default
"surface-last"onMirrorError()?
optionalonMirrorError: (error,context) =>void
Defined in: plugins/replication/src/PluginSyncEngine.ts:69
Optional hook for swallowed mirror failures (after-source or swallow mode).
Parameters
error
Error
context
pluginIndex
number
eventId
string
Returns
void
Default
undefinedmirrorPersistPayloadMode?
optionalmirrorPersistPayloadMode:MirrorPersistPayloadMode
Defined in: plugins/replication/src/PluginSyncEngine.ts:77
Strategy for payload sent to mirror plugins during bulkPersist.
- original-event: mirrors receive the same operation payload.
- resolve-from-source-result: mirror payload is rebuilt with resolveBulkPersistChanges(...), useful when source generated ids must be mirrored downstream.
Default
"original-event"pluginCallTimeoutMs?
optionalpluginCallTimeoutMs:number
Defined in: plugins/replication/src/PluginSyncEngine.ts:84
Max time (ms) to wait for a composed plugin to call done() before treating the call as failed. Guards the engine against a plugin that never completes — otherwise one hung plugin stalls every operation routed through it forever. 0 disables.
Default
60_000