@daiso-tech/core 0.26.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -3
- package/dist/async/utilities/delay/delay.d.ts +1 -12
- package/dist/async/utilities/delay/delay.js +1 -12
- package/dist/async/utilities/delay/delay.js.map +1 -1
- package/dist/async/utilities/lazy-promise/lazy-promise.d.ts +143 -71
- package/dist/async/utilities/lazy-promise/lazy-promise.js +223 -142
- package/dist/async/utilities/lazy-promise/lazy-promise.js.map +1 -1
- package/dist/async/utilities/retry/retry-or-fail.d.ts +2 -0
- package/dist/async/utilities/retry/retry-or-fail.js.map +1 -1
- package/dist/cache/contracts/_module-exports.d.ts +1 -0
- package/dist/cache/contracts/_module-exports.js +1 -0
- package/dist/cache/contracts/_module-exports.js.map +1 -1
- package/dist/cache/contracts/cache-adapter.contract.d.ts +19 -21
- package/dist/cache/contracts/cache-adapter.contract.js +1 -4
- package/dist/cache/contracts/cache-adapter.contract.js.map +1 -1
- package/dist/cache/contracts/cache-factory.contract.d.ts +1 -1
- package/dist/cache/contracts/cache.contract.d.ts +144 -96
- package/dist/cache/contracts/cache.contract.js +1 -2
- package/dist/cache/contracts/cache.contract.js.map +1 -1
- package/dist/cache/contracts/cache.errors.js +2 -5
- package/dist/cache/contracts/cache.errors.js.map +1 -1
- package/dist/cache/contracts/cache.events.d.ts +10 -10
- package/dist/cache/contracts/cache.events.js +2 -5
- package/dist/cache/contracts/cache.events.js.map +1 -1
- package/dist/cache/contracts/database-cache-adapter.contract.d.ts +89 -0
- package/dist/cache/contracts/database-cache-adapter.contract.js +5 -0
- package/dist/cache/contracts/database-cache-adapter.contract.js.map +1 -0
- package/dist/cache/implementations/adapters/{kysely-sqlite-cache-adapter → kysely-cache-adapter}/_module.d.ts +1 -1
- package/dist/cache/implementations/adapters/kysely-cache-adapter/_module.js +2 -0
- package/dist/cache/implementations/adapters/kysely-cache-adapter/_module.js.map +1 -0
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.d.ts +73 -0
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js +224 -0
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js.map +1 -0
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.d.ts +29 -39
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +45 -54
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +17 -33
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +43 -52
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.d.ts +13 -0
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.js +38 -0
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.js.map +1 -0
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +27 -33
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +145 -197
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +14 -13
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +19 -17
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.d.ts +13 -0
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.js +39 -0
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.js.map +1 -0
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +16 -22
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +51 -132
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.d.ts +13 -0
- package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js +69 -0
- package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js.map +1 -0
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.d.ts +29 -41
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +46 -55
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/derivables/_module-exports.d.ts +1 -1
- package/dist/cache/implementations/derivables/_module-exports.js +1 -1
- package/dist/cache/implementations/derivables/_module-exports.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/_module.d.ts +1 -0
- package/dist/cache/implementations/derivables/cache/_module.js +1 -0
- package/dist/cache/implementations/derivables/cache/_module.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/cache.d.ts +269 -507
- package/dist/cache/implementations/derivables/cache/cache.js +538 -822
- package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/database-cache-adapter.d.ts +21 -0
- package/dist/cache/implementations/derivables/cache/database-cache-adapter.js +110 -0
- package/dist/cache/implementations/derivables/cache/database-cache-adapter.js.map +1 -0
- package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.d.ts +9 -0
- package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.js +20 -0
- package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.js.map +1 -0
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.d.ts +69 -105
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js +117 -87
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js.map +1 -1
- package/dist/cache/implementations/test-utilities/_module-exports.d.ts +1 -0
- package/dist/cache/implementations/test-utilities/_module-exports.js +1 -0
- package/dist/cache/implementations/test-utilities/_module-exports.js.map +1 -1
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.d.ts +9 -11
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js +246 -247
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js.map +1 -1
- package/dist/cache/implementations/test-utilities/cache.test-suite.d.ts +16 -30
- package/dist/cache/implementations/test-utilities/cache.test-suite.js +271 -996
- package/dist/cache/implementations/test-utilities/cache.test-suite.js.map +1 -1
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.d.ts +60 -0
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js +698 -0
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js.map +1 -0
- package/dist/collection/contracts/async-collection.contract.d.ts +2 -3
- package/dist/collection/contracts/async-collection.contract.js +1 -12
- package/dist/collection/contracts/async-collection.contract.js.map +1 -1
- package/dist/collection/contracts/collection.contract.d.ts +1 -1
- package/dist/collection/contracts/collection.errors.d.ts +1 -1
- package/dist/collection/contracts/collection.errors.js +3 -6
- package/dist/collection/contracts/collection.errors.js.map +1 -1
- package/dist/collection/implementations/_shared.d.ts +4 -4
- package/dist/collection/implementations/_shared.js +6 -9
- package/dist/collection/implementations/_shared.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js +2 -2
- package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +5 -21
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +12 -8
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/iterable-collection.d.ts +1 -1
- package/dist/collection/implementations/iterable-collection/iterable-collection.js +1 -1
- package/dist/collection/implementations/list-collection/list-collection.d.ts +1 -1
- package/dist/collection/implementations/list-collection/list-collection.js +1 -1
- package/dist/event-bus/contracts/event-bus-adapter.contract.d.ts +0 -9
- package/dist/event-bus/contracts/event-bus.contract.d.ts +5 -5
- package/dist/event-bus/contracts/event-bus.contract.js.map +1 -1
- package/dist/event-bus/contracts/event-bus.errors.js +2 -5
- package/dist/event-bus/contracts/event-bus.errors.js.map +1 -1
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +9 -29
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +14 -35
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -1
- package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +2 -4
- package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +2 -8
- package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -1
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +8 -15
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +15 -34
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -1
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +85 -289
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +128 -325
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
- package/dist/event-bus/implementations/derivables/event-bus/listener-store.d.ts +13 -0
- package/dist/event-bus/implementations/derivables/event-bus/listener-store.js +42 -0
- package/dist/event-bus/implementations/derivables/event-bus/listener-store.js.map +1 -0
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.d.ts +103 -86
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js +135 -77
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js.map +1 -1
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.d.ts +2 -48
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js +31 -122
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js.map +1 -1
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.d.ts +2 -50
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js +41 -89
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js.map +1 -1
- package/dist/lock/contracts/database-lock-adapter.contract.d.ts +0 -9
- package/dist/lock/contracts/lock-adapter.contract.d.ts +0 -9
- package/dist/lock/contracts/lock-provider.contract.d.ts +20 -6
- package/dist/lock/contracts/lock.contract.d.ts +37 -8
- package/dist/lock/contracts/lock.errors.js +2 -5
- package/dist/lock/contracts/lock.errors.js.map +1 -1
- package/dist/lock/contracts/lock.events.js +2 -5
- package/dist/lock/contracts/lock.events.js.map +1 -1
- package/dist/lock/implementations/adapters/_module-exports.d.ts +1 -0
- package/dist/lock/implementations/adapters/_module-exports.js +1 -0
- package/dist/lock/implementations/adapters/_module-exports.js.map +1 -1
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.d.ts +0 -5
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js +2 -21
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.d.ts +11 -16
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js +11 -20
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.d.ts +7 -26
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js +7 -35
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +13 -20
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +13 -37
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/no-op-lock-adapter/_module.d.ts +1 -0
- package/dist/lock/implementations/adapters/no-op-lock-adapter/_module.js +2 -0
- package/dist/lock/implementations/adapters/no-op-lock-adapter/_module.js.map +1 -0
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.d.ts +17 -0
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js +24 -0
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js.map +1 -0
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.d.ts +4 -22
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js +4 -31
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.d.ts +14 -20
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js +12 -21
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.d.ts +0 -2
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js +2 -8
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js +1 -5
- package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +181 -369
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +259 -407
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.d.ts +15 -17
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js +42 -40
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-state.d.ts +3 -3
- package/dist/lock/implementations/derivables/lock-provider/lock-state.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +194 -680
- package/dist/lock/implementations/derivables/lock-provider/lock.js +284 -744
- package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +106 -143
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js +173 -101
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map +1 -1
- package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.d.ts +4 -5
- package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js +172 -247
- package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js.map +1 -1
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.d.ts +5 -8
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js +93 -98
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js.map +1 -1
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.d.ts +15 -20
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +295 -145
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
- package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js +1 -2
- package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js.map +1 -1
- package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.d.ts +3 -2
- package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js +2 -1
- package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js.map +1 -1
- package/dist/serde/implementations/adapters/redis-serde/redis-serde.js +1 -2
- package/dist/serde/implementations/adapters/redis-serde/redis-serde.js.map +1 -1
- package/dist/serde/implementations/adapters/sql-serde/sql-serde.js +1 -2
- package/dist/serde/implementations/adapters/sql-serde/sql-serde.js.map +1 -1
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.d.ts +2 -2
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js +2 -2
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js.map +1 -1
- package/dist/serde/implementations/derivables/serde.d.ts +14 -14
- package/dist/serde/implementations/derivables/serde.js +14 -15
- package/dist/serde/implementations/derivables/serde.js.map +1 -1
- package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.d.ts +4 -4
- package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.js +3 -3
- package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.d.ts +5 -5
- package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js +4 -4
- package/dist/utilities/_module-exports.d.ts +2 -3
- package/dist/utilities/_module-exports.js +2 -3
- package/dist/utilities/_module-exports.js.map +1 -1
- package/dist/utilities/classes/_module.d.ts +4 -0
- package/dist/utilities/classes/_module.js +5 -0
- package/dist/utilities/classes/_module.js.map +1 -0
- package/dist/utilities/classes/key-prefixer/_module.d.ts +2 -0
- package/dist/utilities/classes/key-prefixer/_module.js +3 -0
- package/dist/utilities/classes/key-prefixer/_module.js.map +1 -0
- package/dist/utilities/classes/key-prefixer/key-prefixer.contract.d.ts +28 -0
- package/dist/utilities/classes/key-prefixer/key-prefixer.contract.js +5 -0
- package/dist/utilities/classes/key-prefixer/key-prefixer.contract.js.map +1 -0
- package/dist/utilities/classes/key-prefixer/key-prefixer.d.ts +73 -0
- package/dist/utilities/classes/key-prefixer/key-prefixer.js +135 -0
- package/dist/utilities/classes/key-prefixer/key-prefixer.js.map +1 -0
- package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.d.ts +1 -0
- package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.js +2 -0
- package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.js.map +1 -0
- package/dist/utilities/classes/kysely-table-name-transformer-plugin/kysely-table-name-transformer-plugin.js.map +1 -0
- package/dist/utilities/classes/pipeline/_module.d.ts +1 -0
- package/dist/utilities/classes/pipeline/_module.js +2 -0
- package/dist/utilities/classes/pipeline/_module.js.map +1 -0
- package/dist/utilities/{pipeline → classes/pipeline}/pipeline.d.ts +3 -2
- package/dist/utilities/{pipeline → classes/pipeline}/pipeline.js +3 -2
- package/dist/utilities/classes/pipeline/pipeline.js.map +1 -0
- package/dist/utilities/classes/time-span/_module.d.ts +1 -0
- package/dist/utilities/classes/time-span/_module.js +2 -0
- package/dist/utilities/classes/time-span/_module.js.map +1 -0
- package/dist/utilities/{time-span → classes/time-span}/time-span.d.ts +2 -1
- package/dist/utilities/{time-span → classes/time-span}/time-span.js +1 -0
- package/dist/utilities/classes/time-span/time-span.js.map +1 -0
- package/dist/utilities/{_constants.d.ts → constants.d.ts} +0 -3
- package/dist/utilities/constants.js +5 -0
- package/dist/utilities/constants.js.map +1 -0
- package/dist/utilities/contracts/_module.d.ts +3 -1
- package/dist/utilities/contracts/_module.js +3 -1
- package/dist/utilities/contracts/_module.js.map +1 -1
- package/dist/utilities/contracts/prunable.contract.d.ts +11 -0
- package/dist/utilities/contracts/prunable.contract.js +5 -0
- package/dist/utilities/contracts/prunable.contract.js.map +1 -0
- package/dist/utilities/contracts/sqlite-database.contract.d.ts +26 -0
- package/dist/utilities/contracts/sqlite-database.contract.js +5 -0
- package/dist/utilities/contracts/sqlite-database.contract.js.map +1 -0
- package/dist/utilities/functions.d.ts +34 -2
- package/dist/utilities/functions.js +72 -4
- package/dist/utilities/functions.js.map +1 -1
- package/dist/utilities/types.d.ts +49 -16
- package/package.json +14 -13
- package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/_module.js +0 -2
- package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/_module.js.map +0 -1
- package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.d.ts +0 -61
- package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js +0 -318
- package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js.map +0 -1
- package/dist/utilities/_constants.js +0 -8
- package/dist/utilities/_constants.js.map +0 -1
- package/dist/utilities/kysely/_module.d.ts +0 -1
- package/dist/utilities/kysely/_module.js +0 -2
- package/dist/utilities/kysely/_module.js.map +0 -1
- package/dist/utilities/kysely/kysely-table-name-transformer-plugin.js.map +0 -1
- package/dist/utilities/pipeline/_module.d.ts +0 -1
- package/dist/utilities/pipeline/_module.js +0 -2
- package/dist/utilities/pipeline/_module.js.map +0 -1
- package/dist/utilities/pipeline/pipeline.js.map +0 -1
- package/dist/utilities/time-span/_module.d.ts +0 -1
- package/dist/utilities/time-span/_module.js +0 -2
- package/dist/utilities/time-span/_module.js.map +0 -1
- package/dist/utilities/time-span/time-span.js.map +0 -1
- /package/dist/utilities/{kysely → classes/kysely-table-name-transformer-plugin}/kysely-table-name-transformer-plugin.d.ts +0 -0
- /package/dist/utilities/{kysely → classes/kysely-table-name-transformer-plugin}/kysely-table-name-transformer-plugin.js +0 -0
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Lock
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { resolveOneOrMore, TimeSpan, } from "../../../../utilities/_module-exports.js";
|
|
5
|
+
import { KeyPrefixer, resolveFactoryable, } from "../../../../utilities/_module-exports.js";
|
|
5
6
|
import {} from "../../../../lock/contracts/_module-exports.js";
|
|
6
|
-
import {
|
|
7
|
+
import { LazyPromise, } from "../../../../async/_module-exports.js";
|
|
8
|
+
import { isDatabaseLockAdapter } from "../../../../lock/implementations/derivables/lock-provider/is-database-lock-adapter.js";
|
|
9
|
+
import { DatabaseLockAdapter } from "../../../../lock/implementations/derivables/lock-provider/database-lock-adapter.js";
|
|
7
10
|
import { EventBus } from "../../../../event-bus/implementations/derivables/_module-exports.js";
|
|
8
11
|
import { MemoryEventBusAdapter } from "../../../../event-bus/implementations/adapters/_module-exports.js";
|
|
9
12
|
import { v4 } from "uuid";
|
|
10
|
-
import {
|
|
13
|
+
import { Lock } from "../../../../lock/implementations/derivables/lock-provider/lock.js";
|
|
14
|
+
import { LockState, } from "../../../../lock/implementations/derivables/lock-provider/lock-state.js";
|
|
11
15
|
import { LockSerdeTransformer } from "../../../../lock/implementations/derivables/lock-provider/lock-serde-transformer.js";
|
|
12
|
-
import { isDatabaseLockAdapter } from "../../../../lock/implementations/derivables/lock-provider/is-database-lock-adapter.js";
|
|
13
16
|
/**
|
|
14
17
|
* <i>LockProvider</i> class can be derived from any <i>{@link ILockAdapter}</i> or <i>{@link IDatabaseLockAdapter}</i>.
|
|
15
18
|
*
|
|
@@ -17,503 +20,352 @@ import { isDatabaseLockAdapter } from "../../../../lock/implementations/derivabl
|
|
|
17
20
|
* allowing them to be seamlessly transferred across different servers, processes, and databases.
|
|
18
21
|
* This can be done directly using <i>{@link IFlexibleSerde}</i> or indirectly through components that rely on <i>{@link IFlexibleSerde}</i> internally.
|
|
19
22
|
*
|
|
20
|
-
* IMPORT_PATH: ```"@daiso-tech/core/lock
|
|
23
|
+
* IMPORT_PATH: ```"@daiso-tech/core/lock"```
|
|
21
24
|
* @group Derivables
|
|
22
25
|
*/
|
|
23
26
|
export class LockProvider {
|
|
24
|
-
static
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
static resolveLockAdapter(adapter) {
|
|
28
|
+
if (isDatabaseLockAdapter(adapter)) {
|
|
29
|
+
return new DatabaseLockAdapter(adapter);
|
|
30
|
+
}
|
|
31
|
+
return adapter;
|
|
32
|
+
}
|
|
33
|
+
static async resolveLockAdapterFactoryable(factoryable, settings) {
|
|
34
|
+
const { serde, lockStore, keyPrefixer, createLazyPromise, defaultBlockingInterval, defaultBlockingTime, defaultRefreshTime, groupableEventBus, } = settings;
|
|
35
|
+
const adapter = await resolveFactoryable(factoryable, keyPrefixer.keyPrefix);
|
|
36
|
+
const resolvedAdapter = LockProvider.resolveLockAdapter(adapter);
|
|
37
|
+
const transformer = new LockSerdeTransformer({
|
|
38
|
+
keyPrefixer,
|
|
39
|
+
adapter: resolvedAdapter,
|
|
40
|
+
createLazyPromise,
|
|
41
|
+
lockStore,
|
|
42
|
+
defaultBlockingInterval,
|
|
43
|
+
defaultBlockingTime,
|
|
44
|
+
defaultRefreshTime,
|
|
45
|
+
groupableEventBus,
|
|
46
|
+
});
|
|
47
|
+
for (const serde_ of resolveOneOrMore(serde)) {
|
|
48
|
+
serde_.registerCustom(transformer);
|
|
49
|
+
}
|
|
50
|
+
return resolvedAdapter;
|
|
51
|
+
}
|
|
52
|
+
lockStore = {};
|
|
53
|
+
groupableEventBus;
|
|
54
|
+
eventBus;
|
|
55
|
+
adapterFactoryable;
|
|
56
|
+
adapterPromise;
|
|
57
|
+
retryAttempts;
|
|
58
|
+
backoffPolicy;
|
|
59
|
+
retryPolicy;
|
|
60
|
+
retryTimeout;
|
|
61
|
+
totalTimeout;
|
|
62
|
+
keyPrefixer;
|
|
27
63
|
createOwnerId;
|
|
28
|
-
adapter;
|
|
29
64
|
defaultTtl;
|
|
30
65
|
defaultBlockingInterval;
|
|
31
66
|
defaultBlockingTime;
|
|
32
67
|
defaultRefreshTime;
|
|
33
|
-
|
|
34
|
-
backoffPolicy;
|
|
35
|
-
retryPolicy;
|
|
36
|
-
timeout;
|
|
37
|
-
eventBus;
|
|
38
|
-
lockProviderEventBus;
|
|
39
|
-
stateRecord = {};
|
|
68
|
+
serde;
|
|
40
69
|
/**
|
|
41
70
|
* @example
|
|
42
71
|
* ```ts
|
|
43
|
-
* import
|
|
44
|
-
* import { LockProvider } from "@daiso-tech/core/lock
|
|
45
|
-
* import {
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
72
|
+
* import { SqliteLockAdapter } from "@daiso-tech/core/lock/adapters";
|
|
73
|
+
* import { LockProvider } from "@daiso-tech/core/lock";
|
|
74
|
+
* import { KeyPrefixer } from "@daiso-tech/core/utilities";
|
|
75
|
+
*
|
|
76
|
+
* const database = new Sqlite("local.db");
|
|
77
|
+
* const lockAdapter = new SqliteLockAdapter({
|
|
78
|
+
* database,
|
|
79
|
+
* });
|
|
80
|
+
* // You need initialize the adapter once before using it.
|
|
81
|
+
* await lockAdapter.init();
|
|
50
82
|
*
|
|
51
|
-
* const
|
|
52
|
-
*
|
|
83
|
+
* const lockProvider = new LockProvider({
|
|
84
|
+
* keyPrefixer: new KeyPrefixer("lock"),
|
|
85
|
+
* adapter: lockAdapter,
|
|
53
86
|
* });
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* You can pass factory function that will create an adapter for every group.
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* import { SqliteLockAdapter } from "@daiso-tech/core/lock/adapters";
|
|
93
|
+
* import type { ILockAdapter } from "@daiso-tech/core/lock/contracts";
|
|
94
|
+
* import { LockProvider } from "@daiso-tech/core/lock";
|
|
95
|
+
* import { KeyPrefixer, type ISqliteDatabase, type FactoryFn } from "@daiso-tech/core/utilities";
|
|
96
|
+
*
|
|
97
|
+
* async function lockAdapterFactory(database: ISqliteDatabase): FactoryFn<string, ILockAdapter> {
|
|
98
|
+
* return async (prefix) => {
|
|
99
|
+
* const lockAdapter = new SqliteLockAdapter({
|
|
100
|
+
* database,
|
|
101
|
+
* tableName: `lock_${prefix}`,
|
|
102
|
+
* });
|
|
103
|
+
* // You need initialize the adapter once before using it.
|
|
104
|
+
* await lockAdapter.init();
|
|
105
|
+
* return lockAdapter;
|
|
106
|
+
* }
|
|
107
|
+
* }
|
|
108
|
+
*
|
|
109
|
+
* const database = new Sqlite("local.db");
|
|
110
|
+
* const lockProvider = new LockProvider({
|
|
111
|
+
* keyPrefixer: new KeyPrefixer("lock"),
|
|
112
|
+
* adapter: lockAdapterFactory(database),
|
|
113
|
+
* });
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
116
|
+
* You can also pass factory object that implements <i>{@link IFactoryObject}</i> contract. This useful for depedency injection libraries.
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* import { SqliteLockAdapter } from "@daiso-tech/core/lock/adapters";
|
|
120
|
+
* import type { ILockAdapter } from "@daiso-tech/core/lock/contracts";
|
|
121
|
+
* import { LockProvider } from "@daiso-tech/core/lock";
|
|
122
|
+
* import { KeyPrefixer, type ISqliteDatabase, type IFactoryObject, type Promiseable } from "@daiso-tech/core/utilities";
|
|
123
|
+
*
|
|
124
|
+
* class LockAdapterFactory implements IFactoryObject<string, ILockAdapter> {
|
|
125
|
+
* constructor(private readonly database: ISqliteDatabase) {}
|
|
126
|
+
*
|
|
127
|
+
* async use(prefix: string): Promiseable<ILockAdapter> {
|
|
128
|
+
* const lockAdapter = new SqliteLockAdapter({
|
|
129
|
+
* database,
|
|
130
|
+
* tableName: `lock_${prefix}`,
|
|
131
|
+
* });
|
|
132
|
+
* // You need initialize the adapter once before using it.
|
|
133
|
+
* await lockAdapter.init();
|
|
134
|
+
* return lockAdapter;
|
|
135
|
+
* }
|
|
136
|
+
* }
|
|
137
|
+
*
|
|
138
|
+
* const database = new Sqlite("local.db");
|
|
139
|
+
* const lockProvider = new LockProvider({
|
|
140
|
+
* keyPrefixer: new KeyPrefixer("lock"),
|
|
141
|
+
* adapter: new LockAdapterFactory(database),
|
|
61
142
|
* });
|
|
62
143
|
* ```
|
|
63
144
|
*/
|
|
64
145
|
constructor(settings) {
|
|
65
|
-
const {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}), serde, } = settings;
|
|
70
|
-
this.createOwnerId = createOwnerId;
|
|
71
|
-
if (isDatabaseLockAdapter(adapter)) {
|
|
72
|
-
this.adapter = new DatabaseLockAdapter(adapter);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
this.adapter = adapter;
|
|
76
|
-
}
|
|
146
|
+
const { defaultTtl = TimeSpan.fromMinutes(5), defaultBlockingInterval = TimeSpan.fromSeconds(1), defaultBlockingTime = TimeSpan.fromMinutes(1), defaultRefreshTime = TimeSpan.fromMinutes(5), createOwnerId = () => v4(), serde, keyPrefixer, adapter, eventBus: groupableEventBus = new EventBus({
|
|
147
|
+
keyPrefixer: new KeyPrefixer("events"),
|
|
148
|
+
adapter: new MemoryEventBusAdapter(),
|
|
149
|
+
}), retryAttempts = null, backoffPolicy = null, retryPolicy = null, retryTimeout = null, totalTimeout = null, } = settings;
|
|
77
150
|
this.serde = serde;
|
|
78
|
-
this.defaultTtl = defaultTtl ?? LockProvider.DEFAULT_TTL;
|
|
79
151
|
this.defaultBlockingInterval = defaultBlockingInterval;
|
|
80
152
|
this.defaultBlockingTime = defaultBlockingTime;
|
|
81
153
|
this.defaultRefreshTime = defaultRefreshTime;
|
|
154
|
+
this.createOwnerId = createOwnerId;
|
|
155
|
+
this.keyPrefixer = keyPrefixer;
|
|
156
|
+
this.groupableEventBus = groupableEventBus;
|
|
157
|
+
this.adapterFactoryable = adapter;
|
|
158
|
+
this.defaultTtl = defaultTtl;
|
|
82
159
|
this.retryAttempts = retryAttempts;
|
|
83
160
|
this.backoffPolicy = backoffPolicy;
|
|
84
161
|
this.retryPolicy = retryPolicy;
|
|
85
|
-
this.
|
|
86
|
-
this.
|
|
87
|
-
this.
|
|
88
|
-
this.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
defaultBlockingTime: this.defaultBlockingTime,
|
|
94
|
-
adapter: this.adapter,
|
|
95
|
-
backoffPolicy: this.backoffPolicy,
|
|
96
|
-
defaultRefreshTime: this.defaultRefreshTime,
|
|
97
|
-
eventBus: this.eventBus,
|
|
98
|
-
retryAttempts: this.retryAttempts,
|
|
99
|
-
retryPolicy: this.retryPolicy,
|
|
100
|
-
timeout: this.timeout,
|
|
101
|
-
});
|
|
102
|
-
let serde = this.serde;
|
|
103
|
-
if (!Array.isArray(serde)) {
|
|
104
|
-
serde = [serde];
|
|
105
|
-
}
|
|
106
|
-
for (const serde_ of serde) {
|
|
107
|
-
serde_.registerCustom(transformer, CORE);
|
|
162
|
+
this.retryTimeout = retryTimeout;
|
|
163
|
+
this.totalTimeout = totalTimeout;
|
|
164
|
+
this.eventBus = this.eventBus = this.groupableEventBus.withGroup(this.keyPrefixer.resolvedRootPrefix);
|
|
165
|
+
if (this.keyPrefixer.resolvedGroup) {
|
|
166
|
+
this.eventBus = this.groupableEventBus.withGroup([
|
|
167
|
+
this.keyPrefixer.resolvedRootPrefix,
|
|
168
|
+
this.keyPrefixer.resolvedGroup,
|
|
169
|
+
]);
|
|
108
170
|
}
|
|
171
|
+
this.adapterPromise = new LazyPromise(async () => LockProvider.resolveLockAdapterFactoryable(this.adapterFactoryable, {
|
|
172
|
+
serde,
|
|
173
|
+
lockStore: this.lockStore,
|
|
174
|
+
keyPrefixer,
|
|
175
|
+
createLazyPromise: this.createLazyPromise.bind(this),
|
|
176
|
+
defaultBlockingInterval,
|
|
177
|
+
defaultBlockingTime,
|
|
178
|
+
defaultRefreshTime,
|
|
179
|
+
groupableEventBus,
|
|
180
|
+
}));
|
|
109
181
|
}
|
|
110
182
|
/**
|
|
111
|
-
* You can listen to
|
|
112
|
-
*
|
|
113
|
-
* Refer to <i>{@link LockEvents}</i>, to se all events dispatched by <i>LockProvider</i> class instance.
|
|
114
|
-
* Refer to <i>{@link IEventListenable}</i> for details on how the method works.
|
|
115
|
-
* @example
|
|
116
|
-
* ```ts
|
|
117
|
-
* import { type IGroupableLockProvider, type LockEvents, KeyAcquiredLockEvent } from "@daiso-tech/core/lock/contracts";
|
|
118
|
-
* import { LockProvider } from "@daiso-tech/core/lock/implementations/derivables";
|
|
119
|
-
* import { MemoryLockAdapter } from "@daiso-tech/core/lock/implementations/adapters";
|
|
120
|
-
* import type { Invokable} from "@daiso-tech/core/event-bus/contracts";
|
|
121
|
-
* import { EventBus } from "@daiso-tech/core/event-bus/implementations/derivables";
|
|
122
|
-
* import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/implementations/adapters";
|
|
123
|
-
* import { Serde } from "@daiso-tech/core/serde/implementations/derivables";
|
|
124
|
-
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/implementations/adapters";
|
|
125
|
-
*
|
|
126
|
-
* const eventBus = new EventBus({
|
|
127
|
-
* adapter: new MemoryEventBusAdapter({ rootGroup: "@global" })
|
|
128
|
-
* });
|
|
129
|
-
* const serde = new Serde(SuperJsonSerdeAdapter);
|
|
130
|
-
* const lockProvider: IGroupableLockProvider = new LockProvider({
|
|
131
|
-
* serde,
|
|
132
|
-
* adapter: new MemoryLockAdapter({
|
|
133
|
-
* rootGroup: "@global"
|
|
134
|
-
* }),
|
|
135
|
-
* eventBus,
|
|
136
|
-
* });
|
|
137
|
-
*
|
|
138
|
-
* const listener: Invokable<LockEvents> = event => {
|
|
139
|
-
* console.log(event);
|
|
140
|
-
* }
|
|
141
|
-
* await lockProvider.addListener(KeyAcquiredLockEvent, listener);
|
|
142
|
-
* await lockProvider.removeListener(KeyAcquiredLockEvent, listener);
|
|
143
|
-
* await lockProvider.create("a").acquire();
|
|
144
|
-
* ```
|
|
183
|
+
* You can listen to the following <i>{@link LockEvents}</i> of all <i>{@link ILock}</i> instances created by the <i>{@link ILockProvider}</i>.
|
|
184
|
+
* To understand how this method works, refer to <i>{@link IEventListenable}</i>.
|
|
145
185
|
*/
|
|
146
186
|
addListener(event, listener) {
|
|
147
|
-
return this.
|
|
187
|
+
return this.eventBus.addListener(event, listener);
|
|
148
188
|
}
|
|
149
189
|
/**
|
|
150
|
-
* You can listen to
|
|
151
|
-
*
|
|
152
|
-
* Refer to <i>{@link LockEvents}</i>, to se all events dispatched by <i>LockProvider</i> class instance.
|
|
153
|
-
* Refer to <i>{@link IEventListenable}</i> for details on how the method works.
|
|
154
|
-
* @example
|
|
155
|
-
* ```ts
|
|
156
|
-
* import { type IGroupableLockProvider, type LockEvents, KeyAcquiredLockEvent } from "@daiso-tech/core/lock/contracts";
|
|
157
|
-
* import { LockProvider } from "@daiso-tech/core/lock/implementations/derivables";
|
|
158
|
-
* import { MemoryLockAdapter } from "@daiso-tech/core/lock/implementations/adapters";
|
|
159
|
-
* import type { Invokable} from "@daiso-tech/core/event-bus/contracts";
|
|
160
|
-
* import { EventBus } from "@daiso-tech/core/event-bus/implementations/derivables";
|
|
161
|
-
* import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/implementations/adapters";
|
|
162
|
-
* import { Serde } from "@daiso-tech/core/serde/implementations/derivables";
|
|
163
|
-
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/implementations/adapters";
|
|
164
|
-
*
|
|
165
|
-
* const eventBus = new EventBus({
|
|
166
|
-
* adapter: new MemoryEventBusAdapter({ rootGroup: "@global" })
|
|
167
|
-
* });
|
|
168
|
-
* const serde = new Serde(SuperJsonSerdeAdapter);
|
|
169
|
-
* const lockProvider: IGroupableLockProvider = new LockProvider({
|
|
170
|
-
* serde,
|
|
171
|
-
* adapter: new MemoryLockAdapter({
|
|
172
|
-
* rootGroup: "@global"
|
|
173
|
-
* }),
|
|
174
|
-
* eventBus,
|
|
175
|
-
* });
|
|
176
|
-
*
|
|
177
|
-
* const listener: Invokable<LockEvents> = event => {
|
|
178
|
-
* console.log(event);
|
|
179
|
-
* }
|
|
180
|
-
* await lockProvider.addListenerMany([KeyAcquiredLockEvent], listener);
|
|
181
|
-
* await lockProvider.removeListenerMany([KeyAcquiredLockEvent], listener);
|
|
182
|
-
* await lockProvider.create("a").acquire();
|
|
183
|
-
* ```
|
|
190
|
+
* You can listen to the following <i>{@link LockEvents}</i> of all <i>{@link ILock}</i> instances created by the <i>{@link ILockProvider}</i>.
|
|
191
|
+
* To understand how this method works, refer to <i>{@link IEventListenable}</i>.
|
|
184
192
|
*/
|
|
185
193
|
addListenerMany(events, listener) {
|
|
186
|
-
return this.
|
|
194
|
+
return this.eventBus.addListenerMany(events, listener);
|
|
187
195
|
}
|
|
188
196
|
/**
|
|
189
|
-
* You can listen to
|
|
190
|
-
*
|
|
191
|
-
* Refer to <i>{@link LockEvents}</i>, to se all events dispatched by <i>LockProvider</i> class instance.
|
|
192
|
-
* Refer to <i>{@link IEventListenable}</i> for details on how the method works.
|
|
193
|
-
* @example
|
|
194
|
-
* ```ts
|
|
195
|
-
* import { type IGroupableLockProvider, type LockEvents, KeyAcquiredLockEvent } from "@daiso-tech/core/lock/contracts";
|
|
196
|
-
* import { LockProvider } from "@daiso-tech/core/lock/implementations/derivables";
|
|
197
|
-
* import { MemoryLockAdapter } from "@daiso-tech/core/lock/implementations/adapters";
|
|
198
|
-
* import type { Invokable} from "@daiso-tech/core/event-bus/contracts";
|
|
199
|
-
* import { EventBus } from "@daiso-tech/core/event-bus/implementations/derivables";
|
|
200
|
-
* import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/implementations/adapters";
|
|
201
|
-
* import { Serde } from "@daiso-tech/core/serde/implementations/derivables";
|
|
202
|
-
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/implementations/adapters";
|
|
203
|
-
*
|
|
204
|
-
* const eventBus = new EventBus({
|
|
205
|
-
* adapter: new MemoryEventBusAdapter({ rootGroup: "@global" })
|
|
206
|
-
* });
|
|
207
|
-
* const serde = new Serde(SuperJsonSerdeAdapter);
|
|
208
|
-
* const lockProvider: IGroupableLockProvider = new LockProvider({
|
|
209
|
-
* serde,
|
|
210
|
-
* adapter: new MemoryLockAdapter({
|
|
211
|
-
* rootGroup: "@global"
|
|
212
|
-
* }),
|
|
213
|
-
* eventBus,
|
|
214
|
-
* });
|
|
215
|
-
*
|
|
216
|
-
* const listener: Invokable<LockEvents> = event => {
|
|
217
|
-
* console.log(event);
|
|
218
|
-
* }
|
|
219
|
-
* await lockProvider.addListener(KeyAcquiredLockEvent, listener);
|
|
220
|
-
* await lockProvider.removeListener(KeyAcquiredLockEvent, listener);
|
|
221
|
-
* await lockProvider.create("a").acquire();
|
|
222
|
-
* ```
|
|
197
|
+
* You can listen to the following <i>{@link LockEvents}</i> of all <i>{@link ILock}</i> instances created by the <i>{@link ILockProvider}</i>.
|
|
198
|
+
* To understand how this method works, refer to <i>{@link IEventListenable}</i>.
|
|
223
199
|
*/
|
|
224
200
|
removeListener(event, listener) {
|
|
225
|
-
return this.
|
|
201
|
+
return this.eventBus.removeListener(event, listener);
|
|
226
202
|
}
|
|
227
203
|
/**
|
|
228
|
-
* You can listen to
|
|
229
|
-
*
|
|
230
|
-
* Refer to <i>{@link LockEvents}</i>, to se all events dispatched by <i>LockProvider</i> class instance.
|
|
231
|
-
* Refer to <i>{@link IEventListenable}</i> for details on how the method works.
|
|
232
|
-
* @example
|
|
233
|
-
* ```ts
|
|
234
|
-
* import { type IGroupableLockProvider, type LockEvents, KeyAcquiredLockEvent } from "@daiso-tech/core/lock/contracts";
|
|
235
|
-
* import { LockProvider } from "@daiso-tech/core/lock/implementations/derivables";
|
|
236
|
-
* import { MemoryLockAdapter } from "@daiso-tech/core/lock/implementations/adapters";
|
|
237
|
-
* import type { Invokable} from "@daiso-tech/core/event-bus/contracts";
|
|
238
|
-
* import { EventBus } from "@daiso-tech/core/event-bus/implementations/derivables";
|
|
239
|
-
* import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/implementations/adapters";
|
|
240
|
-
* import { Serde } from "@daiso-tech/core/serde/implementations/derivables";
|
|
241
|
-
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/implementations/adapters";
|
|
242
|
-
*
|
|
243
|
-
* const eventBus = new EventBus({
|
|
244
|
-
* adapter: new MemoryEventBusAdapter({ rootGroup: "@global" })
|
|
245
|
-
* });
|
|
246
|
-
* const serde = new Serde(SuperJsonSerdeAdapter);
|
|
247
|
-
* const lockProvider: IGroupableLockProvider = new LockProvider({
|
|
248
|
-
* serde,
|
|
249
|
-
* adapter: new MemoryLockAdapter({
|
|
250
|
-
* rootGroup: "@global"
|
|
251
|
-
* }),
|
|
252
|
-
* eventBus,
|
|
253
|
-
* });
|
|
254
|
-
*
|
|
255
|
-
* const listener: Invokable<LockEvents> = event => {
|
|
256
|
-
* console.log(event);
|
|
257
|
-
* }
|
|
258
|
-
* await lockProvider.addListenerMany(KeyAcquiredLockEvent, listener);
|
|
259
|
-
* await lockProvider.removeListenerMany([KeyAcquiredLockEvent], listener);
|
|
260
|
-
* await lockProvider.create("a").acquire();
|
|
261
|
-
* ```
|
|
204
|
+
* You can listen to the following <i>{@link LockEvents}</i> of all <i>{@link ILock}</i> instances created by the <i>{@link ILockProvider}</i>.
|
|
205
|
+
* To understand how this method works, refer to <i>{@link IEventListenable}</i>.
|
|
262
206
|
*/
|
|
263
207
|
removeListenerMany(events, listener) {
|
|
264
|
-
return this.
|
|
208
|
+
return this.eventBus.removeListenerMany(events, listener);
|
|
265
209
|
}
|
|
266
210
|
/**
|
|
267
|
-
* You can listen to
|
|
268
|
-
*
|
|
269
|
-
* Refer to <i>{@link LockEvents}</i>, to se all events dispatched by <i>LockProvider</i> class instance.
|
|
270
|
-
* Refer to <i>{@link IEventListenable}</i> for details on how the method works.
|
|
271
|
-
* @example
|
|
272
|
-
* ```ts
|
|
273
|
-
* import { type IGroupableLockProvider, type LockEvents, KeyAcquiredLockEvent } from "@daiso-tech/core/lock/contracts";
|
|
274
|
-
* import { LockProvider } from "@daiso-tech/core/lock/implementations/derivables";
|
|
275
|
-
* import { MemoryLockAdapter } from "@daiso-tech/core/lock/implementations/adapters";
|
|
276
|
-
* import type { Invokable} from "@daiso-tech/core/event-bus/contracts";
|
|
277
|
-
* import { EventBus } from "@daiso-tech/core/event-bus/implementations/derivables";
|
|
278
|
-
* import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/implementations/adapters";
|
|
279
|
-
* import { Serde } from "@daiso-tech/core/serde/implementations/derivables";
|
|
280
|
-
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/implementations/adapters";
|
|
281
|
-
*
|
|
282
|
-
* const eventBus = new EventBus({
|
|
283
|
-
* adapter: new MemoryEventBusAdapter({ rootGroup: "@global" })
|
|
284
|
-
* });
|
|
285
|
-
* const serde = new Serde(SuperJsonSerdeAdapter);
|
|
286
|
-
* const lockProvider: IGroupableLockProvider = new LockProvider({
|
|
287
|
-
* serde,
|
|
288
|
-
* adapter: new MemoryLockAdapter({
|
|
289
|
-
* rootGroup: "@global"
|
|
290
|
-
* }),
|
|
291
|
-
* eventBus,
|
|
292
|
-
* });
|
|
293
|
-
*
|
|
294
|
-
* const listener: Invokable<LockEvents> = event => {
|
|
295
|
-
* console.log(event);
|
|
296
|
-
* }
|
|
297
|
-
* await lockProvider.listenOnce(KeyAcquiredLockEvent, listener);
|
|
298
|
-
* await lockProvider.create("a").acquire();
|
|
299
|
-
* ```
|
|
211
|
+
* You can listen to the following <i>{@link LockEvents}</i> of all <i>{@link ILock}</i> instances created by the <i>{@link ILockProvider}</i>.
|
|
212
|
+
* To understand how this method works, refer to <i>{@link IEventListenable}</i>.
|
|
300
213
|
*/
|
|
301
214
|
listenOnce(event, listener) {
|
|
302
|
-
return this.
|
|
215
|
+
return this.eventBus.listenOnce(event, listener);
|
|
303
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* You can listen to the following <i>{@link LockEvents}</i> of all <i>{@link ILock}</i> instances created by the <i>{@link ILockProvider}</i>.
|
|
219
|
+
* To understand how this method works, refer to <i>{@link IEventListenable}</i>.
|
|
220
|
+
*/
|
|
304
221
|
asPromise(event) {
|
|
305
|
-
return this.
|
|
222
|
+
return this.eventBus.asPromise(event);
|
|
306
223
|
}
|
|
307
224
|
/**
|
|
308
|
-
* You can listen to
|
|
309
|
-
*
|
|
310
|
-
* Refer to <i>{@link LockEvents}</i>, to se all events dispatched by <i>LockProvider</i> class instance.
|
|
311
|
-
* Refer to <i>{@link IEventListenable}</i> for details on how the method works.
|
|
312
|
-
* @example
|
|
313
|
-
* ```ts
|
|
314
|
-
* import { type IGroupableLockProvider, type LockEvents, KeyAcquiredLockEvent } from "@daiso-tech/core/lock/contracts";
|
|
315
|
-
* import { LockProvider } from "@daiso-tech/core/lock/implementations/derivables";
|
|
316
|
-
* import { MemoryLockAdapter } from "@daiso-tech/core/lock/implementations/adapters";
|
|
317
|
-
* import type { Invokable} from "@daiso-tech/core/event-bus/contracts";
|
|
318
|
-
* import { EventBus } from "@daiso-tech/core/event-bus/implementations/derivables";
|
|
319
|
-
* import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/implementations/adapters";
|
|
320
|
-
* import { Serde } from "@daiso-tech/core/serde/implementations/derivables";
|
|
321
|
-
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/implementations/adapters";
|
|
322
|
-
*
|
|
323
|
-
* const eventBus = new EventBus({
|
|
324
|
-
* adapter: new MemoryEventBusAdapter({ rootGroup: "@global" })
|
|
325
|
-
* });
|
|
326
|
-
* const serde = new Serde(SuperJsonSerdeAdapter);
|
|
327
|
-
* const lockProvider: IGroupableLockProvider = new LockProvider({
|
|
328
|
-
* serde,
|
|
329
|
-
* adapter: new MemoryLockAdapter({
|
|
330
|
-
* rootGroup: "@global"
|
|
331
|
-
* }),
|
|
332
|
-
* eventBus,
|
|
333
|
-
* });
|
|
334
|
-
*
|
|
335
|
-
* const listener: Invokable<LockEvents> = event => {
|
|
336
|
-
* console.log(event);
|
|
337
|
-
* }
|
|
338
|
-
* const unsubscribe = await lockProvider.subscribe(KeyAcquiredLockEvent, listener);
|
|
339
|
-
* await lockProvider.create("a").acquire();
|
|
340
|
-
* await unsubscribe();
|
|
341
|
-
* ```
|
|
225
|
+
* You can listen to the following <i>{@link LockEvents}</i> of all <i>{@link ILock}</i> instances created by the <i>{@link ILockProvider}</i>.
|
|
226
|
+
* To understand how this method works, refer to <i>{@link IEventListenable}</i>.
|
|
342
227
|
*/
|
|
343
228
|
subscribe(event, listener) {
|
|
344
|
-
return this.
|
|
229
|
+
return this.eventBus.subscribe(event, listener);
|
|
345
230
|
}
|
|
346
231
|
/**
|
|
347
|
-
* You can listen to
|
|
348
|
-
*
|
|
349
|
-
* Refer to <i>{@link LockEvents}</i>, to se all events dispatched by <i>LockProvider</i> class instance.
|
|
350
|
-
* Refer to <i>{@link IEventListenable}</i> for details on how the method works.
|
|
351
|
-
* @example
|
|
352
|
-
* ```ts
|
|
353
|
-
* import { type IGroupableLockProvider, type LockEvents, KeyAcquiredLockEvent } from "@daiso-tech/core/lock/contracts";
|
|
354
|
-
* import { LockProvider } from "@daiso-tech/core/lock/implementations/derivables";
|
|
355
|
-
* import { MemoryLockAdapter } from "@daiso-tech/core/lock/implementations/adapters";
|
|
356
|
-
* import type { Invokable} from "@daiso-tech/core/event-bus/contracts";
|
|
357
|
-
* import { EventBus } from "@daiso-tech/core/event-bus/implementations/derivables";
|
|
358
|
-
* import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/implementations/adapters";
|
|
359
|
-
* import { Serde } from "@daiso-tech/core/serde/implementations/derivables";
|
|
360
|
-
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/implementations/adapters";
|
|
361
|
-
*
|
|
362
|
-
* const eventBus = new EventBus({
|
|
363
|
-
* adapter: new MemoryEventBusAdapter({ rootGroup: "@global" })
|
|
364
|
-
* });
|
|
365
|
-
* const serde = new Serde(SuperJsonSerdeAdapter);
|
|
366
|
-
* const lockProvider: IGroupableLockProvider = new LockProvider({
|
|
367
|
-
* serde,
|
|
368
|
-
* adapter: new MemoryLockAdapter({
|
|
369
|
-
* rootGroup: "@global"
|
|
370
|
-
* }),
|
|
371
|
-
* eventBus,
|
|
372
|
-
* });
|
|
373
|
-
*
|
|
374
|
-
* const listener: Invokable<LockEvents> = event => {
|
|
375
|
-
* console.log(event);
|
|
376
|
-
* }
|
|
377
|
-
* const unsubscribe = await lockProvider.subscribeMany([KeyAcquiredLockEvent], listener);
|
|
378
|
-
* await lockProvider.create("a").acquire();
|
|
379
|
-
* await unsubscribe();
|
|
380
|
-
* ```
|
|
232
|
+
* You can listen to the following <i>{@link LockEvents}</i> of all <i>{@link ILock}</i> instances created by the <i>{@link ILockProvider}</i>.
|
|
233
|
+
* To understand how this method works, refer to <i>{@link IEventListenable}</i>.
|
|
381
234
|
*/
|
|
382
235
|
subscribeMany(events, listener) {
|
|
383
|
-
return this.
|
|
236
|
+
return this.eventBus.subscribeMany(events, listener);
|
|
237
|
+
}
|
|
238
|
+
createLazyPromise(asyncFn) {
|
|
239
|
+
return new LazyPromise(asyncFn, {
|
|
240
|
+
retryAttempts: this.retryAttempts,
|
|
241
|
+
backoffPolicy: this.backoffPolicy,
|
|
242
|
+
retryPolicy: this.retryPolicy,
|
|
243
|
+
retryTimeout: this.retryTimeout,
|
|
244
|
+
totalTimeout: this.totalTimeout,
|
|
245
|
+
});
|
|
384
246
|
}
|
|
385
247
|
/**
|
|
248
|
+
* @example
|
|
386
249
|
* ```ts
|
|
387
|
-
* import
|
|
388
|
-
* import {
|
|
389
|
-
* import {
|
|
390
|
-
* import {
|
|
391
|
-
* import {
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
* adapter: new MemoryEventBusAdapter({ rootGroup: "@global" })
|
|
398
|
-
* });
|
|
399
|
-
* const serde = new Serde(SuperJsonSerdeAdapter);
|
|
400
|
-
* const lockProvider: IGroupableLockProvider = new LockProvider({
|
|
401
|
-
* serde,
|
|
402
|
-
* adapter: new MemoryLockAdapter({
|
|
403
|
-
* rootGroup: "@global"
|
|
404
|
-
* }),
|
|
405
|
-
* eventBus,
|
|
250
|
+
* import { LockProvider } from "@daiso-tech/core/lock";
|
|
251
|
+
* import { MemoryLockAdapter } from "@daiso-tech/core/lock/adapters";
|
|
252
|
+
* import { KeyPrefixer, TimeSpan } from "@daiso-tech/core/utilities";
|
|
253
|
+
* import { Serde } from "@daiso-tech/core/adapter";
|
|
254
|
+
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/adapter/adapters";
|
|
255
|
+
*
|
|
256
|
+
* const lockProvider = new LockProvider({
|
|
257
|
+
* adapter: new MemoryLockAdapter(),
|
|
258
|
+
* keyPrefixer: new KeyPrefixer("lock"),
|
|
259
|
+
* serde: new Serde(new SuperJsonSerdeAdapter())
|
|
406
260
|
* });
|
|
407
261
|
*
|
|
408
|
-
*
|
|
409
|
-
* const lockA = lockProvider.create("a");
|
|
410
|
-
*
|
|
411
|
-
* // You can provide ttl
|
|
412
|
-
* const lockB = lockProvider.create("b", {
|
|
413
|
-
* ttl: TimeSpan.fromMinutes(2),
|
|
414
|
-
* });
|
|
415
|
-
*
|
|
416
|
-
* // You can provide a custom owner. By default the owner will be unique random value.
|
|
417
|
-
* const lockC = lockProvider.create("b", {
|
|
418
|
-
* owner: "user-1"
|
|
419
|
-
* });
|
|
262
|
+
* const lock = lockProvider.create("a");
|
|
420
263
|
* ```
|
|
421
264
|
*/
|
|
422
265
|
create(key, settings = {}) {
|
|
423
266
|
const { ttl = this.defaultTtl, owner = this.createOwnerId() } = settings;
|
|
267
|
+
const keyObj = this.keyPrefixer.create(key);
|
|
268
|
+
let lockEventBus = this.groupableEventBus.withGroup([
|
|
269
|
+
this.keyPrefixer.resolvedRootPrefix,
|
|
270
|
+
keyObj.resolved,
|
|
271
|
+
]);
|
|
272
|
+
if (this.keyPrefixer.resolvedGroup) {
|
|
273
|
+
lockEventBus = this.groupableEventBus.withGroup([
|
|
274
|
+
this.keyPrefixer.resolvedRootPrefix,
|
|
275
|
+
this.keyPrefixer.resolvedGroup,
|
|
276
|
+
keyObj.resolved,
|
|
277
|
+
]);
|
|
278
|
+
}
|
|
424
279
|
return new Lock({
|
|
280
|
+
adapterPromise: this.adapterPromise,
|
|
281
|
+
group: this.keyPrefixer.resolvedGroup,
|
|
282
|
+
createLazyPromise: this.createLazyPromise.bind(this),
|
|
283
|
+
lockState: new LockState(this.lockStore, keyObj.prefixed),
|
|
284
|
+
lockEventBus: lockEventBus,
|
|
285
|
+
lockProviderEventDispatcher: this.eventBus,
|
|
286
|
+
key: keyObj,
|
|
287
|
+
owner,
|
|
288
|
+
ttl,
|
|
289
|
+
expirationInMs: null,
|
|
425
290
|
defaultBlockingInterval: this.defaultBlockingInterval,
|
|
426
291
|
defaultBlockingTime: this.defaultBlockingTime,
|
|
427
|
-
lockProviderEventDispatcher: this.lockProviderEventBus,
|
|
428
|
-
lockEventBus: this.eventBus,
|
|
429
|
-
adapter: this.adapter,
|
|
430
292
|
defaultRefreshTime: this.defaultRefreshTime,
|
|
431
|
-
key: resolveOneOrMoreStr(key),
|
|
432
|
-
owner: resolveOneOrMoreStr(owner),
|
|
433
|
-
ttl,
|
|
434
|
-
lazyPromiseSettings: {
|
|
435
|
-
backoffPolicy: this.backoffPolicy,
|
|
436
|
-
retryAttempts: this.retryAttempts,
|
|
437
|
-
retryPolicy: this.retryPolicy,
|
|
438
|
-
timeout: this.timeout,
|
|
439
|
-
},
|
|
440
|
-
stateRecord: this.stateRecord,
|
|
441
|
-
expirationInMs: null,
|
|
442
293
|
});
|
|
443
294
|
}
|
|
444
295
|
/**
|
|
445
296
|
* @example
|
|
446
297
|
* ```ts
|
|
447
|
-
* import
|
|
448
|
-
* import {
|
|
449
|
-
* import {
|
|
450
|
-
* import {
|
|
451
|
-
* import {
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
*
|
|
457
|
-
* });
|
|
458
|
-
* const serde = new Serde(SuperJsonSerdeAdapter);
|
|
459
|
-
* const lockProvider: IGroupableLockProvider = new LockProvider({
|
|
460
|
-
* serde,
|
|
461
|
-
* adapter: new MemoryLockAdapter({
|
|
462
|
-
* rootGroup: "@global"
|
|
463
|
-
* }),
|
|
464
|
-
* eventBus,
|
|
298
|
+
* import { LockProvider } from "@daiso-tech/core/lock";
|
|
299
|
+
* import { MemoryLockAdapter } from "@daiso-tech/core/lock/adapters";
|
|
300
|
+
* import { KeyPrefixer } from "@daiso-tech/core/utilities";
|
|
301
|
+
* import { Serde } from "@daiso-tech/core/adapter";
|
|
302
|
+
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/adapter/adapters";
|
|
303
|
+
*
|
|
304
|
+
* const lockProvider = new LockProvider({
|
|
305
|
+
* adapter: new MemoryLockAdapter(),
|
|
306
|
+
* keyPrefixer: new KeyPrefixer("lock"),
|
|
307
|
+
* serde: new Serde(new SuperJsonSerdeAdapter())
|
|
465
308
|
* });
|
|
466
309
|
*
|
|
467
|
-
* // Will
|
|
310
|
+
* // Will log null because the lockProvider is not in a group
|
|
468
311
|
* console.log(lockProvider.getGroup());
|
|
312
|
+
*
|
|
313
|
+
* const groupedLockProvider = lockProvider.withGroup("group-a");
|
|
314
|
+
*
|
|
315
|
+
* // Will log "group-a" because the groupedLockProvider is in a group
|
|
316
|
+
* console.log(groupedLockProvider.getGroup());
|
|
469
317
|
* ```
|
|
470
318
|
*/
|
|
471
319
|
getGroup() {
|
|
472
|
-
return this.
|
|
320
|
+
return this.keyPrefixer.resolvedGroup;
|
|
473
321
|
}
|
|
474
322
|
/**
|
|
475
323
|
* @example
|
|
476
324
|
* ```ts
|
|
477
|
-
* import
|
|
478
|
-
* import {
|
|
479
|
-
* import {
|
|
480
|
-
* import {
|
|
481
|
-
* import {
|
|
482
|
-
*
|
|
483
|
-
*
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
325
|
+
* import { LockProvider } from "@daiso-tech/core/lock";
|
|
326
|
+
* import { MemoryLockAdapter } from "@daiso-tech/core/lock/adapters";
|
|
327
|
+
* import { KeyPrefixer } from "@daiso-tech/core/utilities";
|
|
328
|
+
* import { Serde } from "@daiso-tech/core/adapter";
|
|
329
|
+
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/adapter/adapters";
|
|
330
|
+
*
|
|
331
|
+
* const lockProvider = new LockProvider({
|
|
332
|
+
* adapter: new MemoryLockAdapter(),
|
|
333
|
+
* keyPrefixer: new KeyPrefixer("lock"),
|
|
334
|
+
* serde: new Serde(new SuperJsonSerdeAdapter())
|
|
487
335
|
* });
|
|
488
|
-
* const serde = new Serde(SuperJsonSerdeAdapter);
|
|
489
|
-
* const lockProvider: IGroupableLockProvider = new LockProvider({
|
|
490
|
-
* serde,
|
|
491
|
-
* adapter: new MemoryLockAdapter({
|
|
492
|
-
* rootGroup: "@global"
|
|
493
|
-
* }),
|
|
494
|
-
* eventBus,
|
|
495
|
-
* });
|
|
496
|
-
*
|
|
497
|
-
* // Will print "@global"
|
|
498
|
-
* console.log(lockProvider.getGroup());
|
|
499
336
|
*
|
|
500
|
-
* const groupedLockProvider
|
|
501
|
-
*
|
|
502
|
-
* // Will
|
|
503
|
-
* console.log(
|
|
337
|
+
* const groupedLockProvider = lockProvider.withGroup("group-a");
|
|
338
|
+
*
|
|
339
|
+
* // Will log true because they are in different groups.
|
|
340
|
+
* console.log(
|
|
341
|
+
* await lockProvider
|
|
342
|
+
* .create("a")
|
|
343
|
+
* .acquire()
|
|
344
|
+
* );
|
|
345
|
+
*
|
|
346
|
+
* // Will log true because the lockProviders are in different groups.
|
|
347
|
+
* console.log(
|
|
348
|
+
* await groupedLockProvider
|
|
349
|
+
* .create("a")
|
|
350
|
+
* .acquire()
|
|
351
|
+
* );
|
|
504
352
|
* ```
|
|
505
353
|
*/
|
|
506
354
|
withGroup(group) {
|
|
507
355
|
return new LockProvider({
|
|
508
|
-
adapter: this.
|
|
509
|
-
|
|
356
|
+
adapter: this.adapterFactoryable,
|
|
357
|
+
keyPrefixer: this.keyPrefixer.withGroup(group),
|
|
358
|
+
serde: this.serde,
|
|
359
|
+
createOwnerId: this.createOwnerId,
|
|
360
|
+
eventBus: this.groupableEventBus,
|
|
510
361
|
defaultTtl: this.defaultTtl,
|
|
362
|
+
defaultBlockingInterval: this.defaultBlockingInterval,
|
|
363
|
+
defaultBlockingTime: this.defaultBlockingTime,
|
|
511
364
|
defaultRefreshTime: this.defaultRefreshTime,
|
|
512
365
|
retryAttempts: this.retryAttempts,
|
|
513
366
|
backoffPolicy: this.backoffPolicy,
|
|
514
367
|
retryPolicy: this.retryPolicy,
|
|
515
|
-
|
|
516
|
-
serde: this.serde,
|
|
368
|
+
retryTimeout: this.retryTimeout,
|
|
517
369
|
});
|
|
518
370
|
}
|
|
519
371
|
}
|