routier-collection / plugins/replication/src / PluginSyncEngineOptions
Type Alias: PluginSyncEngineOptions
PluginSyncEngineOptions =
object
Defined in: plugins/replication/src/PluginSyncEngine.ts:32
Properties
source
source:
IDbPlugin
Defined in: plugins/replication/src/PluginSyncEngine.ts:34
Primary read/write plugin.
queryPlugins?
optionalqueryPlugins:IDbPlugin[]
Defined in: plugins/replication/src/PluginSyncEngine.ts:40
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:46
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:53
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:60
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:65
When all query routes fail, choose which error to surface.
Default
"surface-last"destroyFailureMode?
optionaldestroyFailureMode:DestroyFailureMode
Defined in: plugins/replication/src/PluginSyncEngine.ts:70
Destroy error policy across composed plugins.
Default
"surface-last"onMirrorError()?
optionalonMirrorError: (error,context) =>void
Defined in: plugins/replication/src/PluginSyncEngine.ts:75
Optional hook for swallowed mirror failures (after-source or swallow mode).
Parameters
error
Error
context
Returns
void
Default
undefinedmirrorPersistPayloadMode?
optionalmirrorPersistPayloadMode:MirrorPersistPayloadMode
Defined in: plugins/replication/src/PluginSyncEngine.ts:83
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"etagOwner?
optionaletagOwner:EtagOwner
Defined in: plugins/replication/src/PluginSyncEngine.ts:84
onMirrorPersisted()?
optionalonMirrorPersisted: (event,result) =>void
Defined in: plugins/replication/src/PluginSyncEngine.ts:85
Parameters
event
DbPluginBulkPersistEvent
result
BulkPersistResult
Returns
void
pluginCallTimeoutMs?
optionalpluginCallTimeoutMs:number
Defined in: plugins/replication/src/PluginSyncEngine.ts:92
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