@orchestr-sh/orchestr 1.7.4 → 1.9.1

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.
Files changed (330) hide show
  1. package/README.md +666 -0
  2. package/dist/Cache/CacheManager.d.ts +109 -0
  3. package/dist/Cache/CacheManager.d.ts.map +1 -0
  4. package/dist/Cache/CacheManager.js +181 -0
  5. package/dist/Cache/CacheManager.js.map +1 -0
  6. package/dist/Cache/CacheServiceProvider.d.ts +19 -0
  7. package/dist/Cache/CacheServiceProvider.d.ts.map +1 -0
  8. package/dist/Cache/CacheServiceProvider.js +71 -0
  9. package/dist/Cache/CacheServiceProvider.js.map +1 -0
  10. package/dist/Cache/Contracts/Lock.d.ts +31 -0
  11. package/dist/Cache/Contracts/Lock.d.ts.map +1 -0
  12. package/dist/Cache/Contracts/Lock.js +3 -0
  13. package/dist/Cache/Contracts/Lock.js.map +1 -0
  14. package/dist/Cache/Contracts/Repository.d.ts +59 -0
  15. package/dist/Cache/Contracts/Repository.d.ts.map +1 -0
  16. package/dist/Cache/Contracts/Repository.js +9 -0
  17. package/dist/Cache/Contracts/Repository.js.map +1 -0
  18. package/dist/Cache/Contracts/Store.d.ts +51 -0
  19. package/dist/Cache/Contracts/Store.d.ts.map +1 -0
  20. package/dist/Cache/Contracts/Store.js +3 -0
  21. package/dist/Cache/Contracts/Store.js.map +1 -0
  22. package/dist/Cache/Events/CacheFlushed.d.ts +11 -0
  23. package/dist/Cache/Events/CacheFlushed.d.ts.map +1 -0
  24. package/dist/Cache/Events/CacheFlushed.js +18 -0
  25. package/dist/Cache/Events/CacheFlushed.js.map +1 -0
  26. package/dist/Cache/Events/CacheHit.d.ts +13 -0
  27. package/dist/Cache/Events/CacheHit.d.ts.map +1 -0
  28. package/dist/Cache/Events/CacheHit.js +22 -0
  29. package/dist/Cache/Events/CacheHit.js.map +1 -0
  30. package/dist/Cache/Events/CacheMissed.d.ts +12 -0
  31. package/dist/Cache/Events/CacheMissed.d.ts.map +1 -0
  32. package/dist/Cache/Events/CacheMissed.js +20 -0
  33. package/dist/Cache/Events/CacheMissed.js.map +1 -0
  34. package/dist/Cache/Events/KeyForgotten.d.ts +12 -0
  35. package/dist/Cache/Events/KeyForgotten.d.ts.map +1 -0
  36. package/dist/Cache/Events/KeyForgotten.js +20 -0
  37. package/dist/Cache/Events/KeyForgotten.js.map +1 -0
  38. package/dist/Cache/Events/KeyWritten.d.ts +14 -0
  39. package/dist/Cache/Events/KeyWritten.d.ts.map +1 -0
  40. package/dist/Cache/Events/KeyWritten.js +24 -0
  41. package/dist/Cache/Events/KeyWritten.js.map +1 -0
  42. package/dist/Cache/Events/index.d.ts +6 -0
  43. package/dist/Cache/Events/index.d.ts.map +1 -0
  44. package/dist/Cache/Events/index.js +14 -0
  45. package/dist/Cache/Events/index.js.map +1 -0
  46. package/dist/Cache/Locks/CacheLock.d.ts +19 -0
  47. package/dist/Cache/Locks/CacheLock.d.ts.map +1 -0
  48. package/dist/Cache/Locks/CacheLock.js +49 -0
  49. package/dist/Cache/Locks/CacheLock.js.map +1 -0
  50. package/dist/Cache/Locks/Lock.d.ts +51 -0
  51. package/dist/Cache/Locks/Lock.d.ts.map +1 -0
  52. package/dist/Cache/Locks/Lock.js +83 -0
  53. package/dist/Cache/Locks/Lock.js.map +1 -0
  54. package/dist/Cache/Locks/LockTimeoutException.d.ts +9 -0
  55. package/dist/Cache/Locks/LockTimeoutException.d.ts.map +1 -0
  56. package/dist/Cache/Locks/LockTimeoutException.js +16 -0
  57. package/dist/Cache/Locks/LockTimeoutException.js.map +1 -0
  58. package/dist/Cache/Locks/index.d.ts +4 -0
  59. package/dist/Cache/Locks/index.d.ts.map +1 -0
  60. package/dist/Cache/Locks/index.js +10 -0
  61. package/dist/Cache/Locks/index.js.map +1 -0
  62. package/dist/Cache/Repository.d.ts +61 -0
  63. package/dist/Cache/Repository.d.ts.map +1 -0
  64. package/dist/Cache/Repository.js +207 -0
  65. package/dist/Cache/Repository.js.map +1 -0
  66. package/dist/Cache/Stores/ArrayStore.d.ts +44 -0
  67. package/dist/Cache/Stores/ArrayStore.d.ts.map +1 -0
  68. package/dist/Cache/Stores/ArrayStore.js +118 -0
  69. package/dist/Cache/Stores/ArrayStore.js.map +1 -0
  70. package/dist/Cache/Stores/DatabaseStore.d.ts +44 -0
  71. package/dist/Cache/Stores/DatabaseStore.d.ts.map +1 -0
  72. package/dist/Cache/Stores/DatabaseStore.js +165 -0
  73. package/dist/Cache/Stores/DatabaseStore.js.map +1 -0
  74. package/dist/Cache/Stores/FileStore.d.ts +50 -0
  75. package/dist/Cache/Stores/FileStore.d.ts.map +1 -0
  76. package/dist/Cache/Stores/FileStore.js +194 -0
  77. package/dist/Cache/Stores/FileStore.js.map +1 -0
  78. package/dist/Cache/Stores/NullStore.d.ts +22 -0
  79. package/dist/Cache/Stores/NullStore.d.ts.map +1 -0
  80. package/dist/Cache/Stores/NullStore.js +49 -0
  81. package/dist/Cache/Stores/NullStore.js.map +1 -0
  82. package/dist/Cache/Stores/index.d.ts +5 -0
  83. package/dist/Cache/Stores/index.d.ts.map +1 -0
  84. package/dist/Cache/Stores/index.js +12 -0
  85. package/dist/Cache/Stores/index.js.map +1 -0
  86. package/dist/Cache/Tags/TagSet.d.ts +39 -0
  87. package/dist/Cache/Tags/TagSet.d.ts.map +1 -0
  88. package/dist/Cache/Tags/TagSet.js +72 -0
  89. package/dist/Cache/Tags/TagSet.js.map +1 -0
  90. package/dist/Cache/Tags/TaggedCache.d.ts +54 -0
  91. package/dist/Cache/Tags/TaggedCache.d.ts.map +1 -0
  92. package/dist/Cache/Tags/TaggedCache.js +125 -0
  93. package/dist/Cache/Tags/TaggedCache.js.map +1 -0
  94. package/dist/Cache/Tags/index.d.ts +3 -0
  95. package/dist/Cache/Tags/index.d.ts.map +1 -0
  96. package/dist/Cache/Tags/index.js +8 -0
  97. package/dist/Cache/Tags/index.js.map +1 -0
  98. package/dist/Cache/index.d.ts +27 -0
  99. package/dist/Cache/index.d.ts.map +1 -0
  100. package/dist/Cache/index.js +48 -0
  101. package/dist/Cache/index.js.map +1 -0
  102. package/dist/Console/Commands/CacheClearCommand.d.ts +16 -0
  103. package/dist/Console/Commands/CacheClearCommand.d.ts.map +1 -0
  104. package/dist/Console/Commands/CacheClearCommand.js +33 -0
  105. package/dist/Console/Commands/CacheClearCommand.js.map +1 -0
  106. package/dist/Console/Commands/CacheForgetCommand.d.ts +16 -0
  107. package/dist/Console/Commands/CacheForgetCommand.d.ts.map +1 -0
  108. package/dist/Console/Commands/CacheForgetCommand.js +39 -0
  109. package/dist/Console/Commands/CacheForgetCommand.js.map +1 -0
  110. package/dist/Console/Commands/CacheTableCommand.d.ts +17 -0
  111. package/dist/Console/Commands/CacheTableCommand.d.ts.map +1 -0
  112. package/dist/Console/Commands/CacheTableCommand.js +92 -0
  113. package/dist/Console/Commands/CacheTableCommand.js.map +1 -0
  114. package/dist/Console/Commands/MakeJobCommand.d.ts +20 -0
  115. package/dist/Console/Commands/MakeJobCommand.d.ts.map +1 -0
  116. package/dist/Console/Commands/MakeJobCommand.js +165 -0
  117. package/dist/Console/Commands/MakeJobCommand.js.map +1 -0
  118. package/dist/Console/Commands/QueueBatchesTableCommand.d.ts +17 -0
  119. package/dist/Console/Commands/QueueBatchesTableCommand.d.ts.map +1 -0
  120. package/dist/Console/Commands/QueueBatchesTableCommand.js +92 -0
  121. package/dist/Console/Commands/QueueBatchesTableCommand.js.map +1 -0
  122. package/dist/Console/Commands/QueueClearCommand.d.ts +16 -0
  123. package/dist/Console/Commands/QueueClearCommand.d.ts.map +1 -0
  124. package/dist/Console/Commands/QueueClearCommand.js +29 -0
  125. package/dist/Console/Commands/QueueClearCommand.js.map +1 -0
  126. package/dist/Console/Commands/QueueFailedCommand.d.ts +18 -0
  127. package/dist/Console/Commands/QueueFailedCommand.d.ts.map +1 -0
  128. package/dist/Console/Commands/QueueFailedCommand.js +76 -0
  129. package/dist/Console/Commands/QueueFailedCommand.js.map +1 -0
  130. package/dist/Console/Commands/QueueFailedTableCommand.d.ts +17 -0
  131. package/dist/Console/Commands/QueueFailedTableCommand.d.ts.map +1 -0
  132. package/dist/Console/Commands/QueueFailedTableCommand.js +89 -0
  133. package/dist/Console/Commands/QueueFailedTableCommand.js.map +1 -0
  134. package/dist/Console/Commands/QueueFlushCommand.d.ts +18 -0
  135. package/dist/Console/Commands/QueueFlushCommand.d.ts.map +1 -0
  136. package/dist/Console/Commands/QueueFlushCommand.js +44 -0
  137. package/dist/Console/Commands/QueueFlushCommand.js.map +1 -0
  138. package/dist/Console/Commands/QueueForgetCommand.d.ts +18 -0
  139. package/dist/Console/Commands/QueueForgetCommand.d.ts.map +1 -0
  140. package/dist/Console/Commands/QueueForgetCommand.js +48 -0
  141. package/dist/Console/Commands/QueueForgetCommand.js.map +1 -0
  142. package/dist/Console/Commands/QueueMonitorCommand.d.ts +16 -0
  143. package/dist/Console/Commands/QueueMonitorCommand.d.ts.map +1 -0
  144. package/dist/Console/Commands/QueueMonitorCommand.js +42 -0
  145. package/dist/Console/Commands/QueueMonitorCommand.js.map +1 -0
  146. package/dist/Console/Commands/QueuePruneBatchesCommand.d.ts +16 -0
  147. package/dist/Console/Commands/QueuePruneBatchesCommand.d.ts.map +1 -0
  148. package/dist/Console/Commands/QueuePruneBatchesCommand.js +44 -0
  149. package/dist/Console/Commands/QueuePruneBatchesCommand.js.map +1 -0
  150. package/dist/Console/Commands/QueuePruneFailedCommand.d.ts +18 -0
  151. package/dist/Console/Commands/QueuePruneFailedCommand.d.ts.map +1 -0
  152. package/dist/Console/Commands/QueuePruneFailedCommand.js +39 -0
  153. package/dist/Console/Commands/QueuePruneFailedCommand.js.map +1 -0
  154. package/dist/Console/Commands/QueueRestartCommand.d.ts +16 -0
  155. package/dist/Console/Commands/QueueRestartCommand.d.ts.map +1 -0
  156. package/dist/Console/Commands/QueueRestartCommand.js +34 -0
  157. package/dist/Console/Commands/QueueRestartCommand.js.map +1 -0
  158. package/dist/Console/Commands/QueueRetryCommand.d.ts +20 -0
  159. package/dist/Console/Commands/QueueRetryCommand.d.ts.map +1 -0
  160. package/dist/Console/Commands/QueueRetryCommand.js +77 -0
  161. package/dist/Console/Commands/QueueRetryCommand.js.map +1 -0
  162. package/dist/Console/Commands/QueueTableCommand.d.ts +17 -0
  163. package/dist/Console/Commands/QueueTableCommand.d.ts.map +1 -0
  164. package/dist/Console/Commands/QueueTableCommand.js +89 -0
  165. package/dist/Console/Commands/QueueTableCommand.js.map +1 -0
  166. package/dist/Console/Commands/QueueWorkCommand.d.ts +16 -0
  167. package/dist/Console/Commands/QueueWorkCommand.d.ts.map +1 -0
  168. package/dist/Console/Commands/QueueWorkCommand.js +51 -0
  169. package/dist/Console/Commands/QueueWorkCommand.js.map +1 -0
  170. package/dist/Facades/Bus.d.ts +62 -0
  171. package/dist/Facades/Bus.d.ts.map +1 -0
  172. package/dist/Facades/Bus.js +102 -0
  173. package/dist/Facades/Bus.js.map +1 -0
  174. package/dist/Facades/Cache.d.ts +41 -0
  175. package/dist/Facades/Cache.d.ts.map +1 -0
  176. package/dist/Facades/Cache.js +78 -0
  177. package/dist/Facades/Cache.js.map +1 -0
  178. package/dist/Facades/Queue.d.ts +42 -0
  179. package/dist/Facades/Queue.d.ts.map +1 -0
  180. package/dist/Facades/Queue.js +71 -0
  181. package/dist/Facades/Queue.js.map +1 -0
  182. package/dist/Facades/index.d.ts +3 -0
  183. package/dist/Facades/index.d.ts.map +1 -1
  184. package/dist/Facades/index.js +7 -1
  185. package/dist/Facades/index.js.map +1 -1
  186. package/dist/Queue/Batching/Batch.d.ts +86 -0
  187. package/dist/Queue/Batching/Batch.d.ts.map +1 -0
  188. package/dist/Queue/Batching/Batch.js +170 -0
  189. package/dist/Queue/Batching/Batch.js.map +1 -0
  190. package/dist/Queue/Batching/PendingBatch.d.ts +72 -0
  191. package/dist/Queue/Batching/PendingBatch.d.ts.map +1 -0
  192. package/dist/Queue/Batching/PendingBatch.js +122 -0
  193. package/dist/Queue/Batching/PendingBatch.js.map +1 -0
  194. package/dist/Queue/Batching/index.d.ts +3 -0
  195. package/dist/Queue/Batching/index.d.ts.map +1 -0
  196. package/dist/Queue/Batching/index.js +8 -0
  197. package/dist/Queue/Batching/index.js.map +1 -0
  198. package/dist/Queue/Concerns/Dispatchable.d.ts +36 -0
  199. package/dist/Queue/Concerns/Dispatchable.d.ts.map +1 -0
  200. package/dist/Queue/Concerns/Dispatchable.js +102 -0
  201. package/dist/Queue/Concerns/Dispatchable.js.map +1 -0
  202. package/dist/Queue/Contracts/QueueDriver.d.ts +67 -0
  203. package/dist/Queue/Contracts/QueueDriver.d.ts.map +1 -0
  204. package/dist/Queue/Contracts/QueueDriver.js +9 -0
  205. package/dist/Queue/Contracts/QueueDriver.js.map +1 -0
  206. package/dist/Queue/Contracts/QueueableJob.d.ts +74 -0
  207. package/dist/Queue/Contracts/QueueableJob.d.ts.map +1 -0
  208. package/dist/Queue/Contracts/QueueableJob.js +9 -0
  209. package/dist/Queue/Contracts/QueueableJob.js.map +1 -0
  210. package/dist/Queue/Contracts/ShouldBeUnique.d.ts +43 -0
  211. package/dist/Queue/Contracts/ShouldBeUnique.d.ts.map +1 -0
  212. package/dist/Queue/Contracts/ShouldBeUnique.js +12 -0
  213. package/dist/Queue/Contracts/ShouldBeUnique.js.map +1 -0
  214. package/dist/Queue/Drivers/DatabaseDriver.d.ts +39 -0
  215. package/dist/Queue/Drivers/DatabaseDriver.d.ts.map +1 -0
  216. package/dist/Queue/Drivers/DatabaseDriver.js +176 -0
  217. package/dist/Queue/Drivers/DatabaseDriver.js.map +1 -0
  218. package/dist/Queue/Drivers/NullDriver.d.ts +30 -0
  219. package/dist/Queue/Drivers/NullDriver.d.ts.map +1 -0
  220. package/dist/Queue/Drivers/NullDriver.js +57 -0
  221. package/dist/Queue/Drivers/NullDriver.js.map +1 -0
  222. package/dist/Queue/Drivers/SyncDriver.d.ts +29 -0
  223. package/dist/Queue/Drivers/SyncDriver.d.ts.map +1 -0
  224. package/dist/Queue/Drivers/SyncDriver.js +67 -0
  225. package/dist/Queue/Drivers/SyncDriver.js.map +1 -0
  226. package/dist/Queue/Drivers/index.d.ts +4 -0
  227. package/dist/Queue/Drivers/index.d.ts.map +1 -0
  228. package/dist/Queue/Drivers/index.js +10 -0
  229. package/dist/Queue/Drivers/index.js.map +1 -0
  230. package/dist/Queue/Events/JobExceptionOccurred.d.ts +13 -0
  231. package/dist/Queue/Events/JobExceptionOccurred.d.ts.map +1 -0
  232. package/dist/Queue/Events/JobExceptionOccurred.js +20 -0
  233. package/dist/Queue/Events/JobExceptionOccurred.js.map +1 -0
  234. package/dist/Queue/Events/JobFailed.d.ts +13 -0
  235. package/dist/Queue/Events/JobFailed.d.ts.map +1 -0
  236. package/dist/Queue/Events/JobFailed.js +20 -0
  237. package/dist/Queue/Events/JobFailed.js.map +1 -0
  238. package/dist/Queue/Events/JobProcessed.d.ts +12 -0
  239. package/dist/Queue/Events/JobProcessed.d.ts.map +1 -0
  240. package/dist/Queue/Events/JobProcessed.js +18 -0
  241. package/dist/Queue/Events/JobProcessed.js.map +1 -0
  242. package/dist/Queue/Events/JobProcessing.d.ts +12 -0
  243. package/dist/Queue/Events/JobProcessing.d.ts.map +1 -0
  244. package/dist/Queue/Events/JobProcessing.js +18 -0
  245. package/dist/Queue/Events/JobProcessing.js.map +1 -0
  246. package/dist/Queue/Events/JobQueued.d.ts +14 -0
  247. package/dist/Queue/Events/JobQueued.d.ts.map +1 -0
  248. package/dist/Queue/Events/JobQueued.js +22 -0
  249. package/dist/Queue/Events/JobQueued.js.map +1 -0
  250. package/dist/Queue/Events/JobRetryRequested.d.ts +12 -0
  251. package/dist/Queue/Events/JobRetryRequested.d.ts.map +1 -0
  252. package/dist/Queue/Events/JobRetryRequested.js +20 -0
  253. package/dist/Queue/Events/JobRetryRequested.js.map +1 -0
  254. package/dist/Queue/Events/WorkerStopping.d.ts +11 -0
  255. package/dist/Queue/Events/WorkerStopping.d.ts.map +1 -0
  256. package/dist/Queue/Events/WorkerStopping.js +18 -0
  257. package/dist/Queue/Events/WorkerStopping.js.map +1 -0
  258. package/dist/Queue/Events/index.d.ts +8 -0
  259. package/dist/Queue/Events/index.d.ts.map +1 -0
  260. package/dist/Queue/Events/index.js +18 -0
  261. package/dist/Queue/Events/index.js.map +1 -0
  262. package/dist/Queue/Failed/DatabaseFailedJobProvider.d.ts +33 -0
  263. package/dist/Queue/Failed/DatabaseFailedJobProvider.d.ts.map +1 -0
  264. package/dist/Queue/Failed/DatabaseFailedJobProvider.js +100 -0
  265. package/dist/Queue/Failed/DatabaseFailedJobProvider.js.map +1 -0
  266. package/dist/Queue/Failed/FailedJobProvider.d.ts +42 -0
  267. package/dist/Queue/Failed/FailedJobProvider.d.ts.map +1 -0
  268. package/dist/Queue/Failed/FailedJobProvider.js +9 -0
  269. package/dist/Queue/Failed/FailedJobProvider.js.map +1 -0
  270. package/dist/Queue/Job.d.ts +194 -0
  271. package/dist/Queue/Job.d.ts.map +1 -0
  272. package/dist/Queue/Job.js +286 -0
  273. package/dist/Queue/Job.js.map +1 -0
  274. package/dist/Queue/JobPayload.d.ts +37 -0
  275. package/dist/Queue/JobPayload.d.ts.map +1 -0
  276. package/dist/Queue/JobPayload.js +46 -0
  277. package/dist/Queue/JobPayload.js.map +1 -0
  278. package/dist/Queue/Middleware/JobMiddleware.d.ts +29 -0
  279. package/dist/Queue/Middleware/JobMiddleware.d.ts.map +1 -0
  280. package/dist/Queue/Middleware/JobMiddleware.js +21 -0
  281. package/dist/Queue/Middleware/JobMiddleware.js.map +1 -0
  282. package/dist/Queue/Middleware/RateLimited.d.ts +56 -0
  283. package/dist/Queue/Middleware/RateLimited.d.ts.map +1 -0
  284. package/dist/Queue/Middleware/RateLimited.js +83 -0
  285. package/dist/Queue/Middleware/RateLimited.js.map +1 -0
  286. package/dist/Queue/Middleware/ThrottlesExceptions.d.ts +71 -0
  287. package/dist/Queue/Middleware/ThrottlesExceptions.d.ts.map +1 -0
  288. package/dist/Queue/Middleware/ThrottlesExceptions.js +119 -0
  289. package/dist/Queue/Middleware/ThrottlesExceptions.js.map +1 -0
  290. package/dist/Queue/Middleware/WithoutOverlapping.d.ts +64 -0
  291. package/dist/Queue/Middleware/WithoutOverlapping.d.ts.map +1 -0
  292. package/dist/Queue/Middleware/WithoutOverlapping.js +103 -0
  293. package/dist/Queue/Middleware/WithoutOverlapping.js.map +1 -0
  294. package/dist/Queue/Middleware/index.d.ts +5 -0
  295. package/dist/Queue/Middleware/index.d.ts.map +1 -0
  296. package/dist/Queue/Middleware/index.js +10 -0
  297. package/dist/Queue/Middleware/index.js.map +1 -0
  298. package/dist/Queue/PendingChain.d.ts +63 -0
  299. package/dist/Queue/PendingChain.d.ts.map +1 -0
  300. package/dist/Queue/PendingChain.js +111 -0
  301. package/dist/Queue/PendingChain.js.map +1 -0
  302. package/dist/Queue/PendingDispatch.d.ts +66 -0
  303. package/dist/Queue/PendingDispatch.d.ts.map +1 -0
  304. package/dist/Queue/PendingDispatch.js +101 -0
  305. package/dist/Queue/PendingDispatch.js.map +1 -0
  306. package/dist/Queue/QueueManager.d.ts +151 -0
  307. package/dist/Queue/QueueManager.d.ts.map +1 -0
  308. package/dist/Queue/QueueManager.js +227 -0
  309. package/dist/Queue/QueueManager.js.map +1 -0
  310. package/dist/Queue/QueueServiceProvider.d.ts +19 -0
  311. package/dist/Queue/QueueServiceProvider.d.ts.map +1 -0
  312. package/dist/Queue/QueueServiceProvider.js +75 -0
  313. package/dist/Queue/QueueServiceProvider.js.map +1 -0
  314. package/dist/Queue/Workers/Worker.d.ts +99 -0
  315. package/dist/Queue/Workers/Worker.d.ts.map +1 -0
  316. package/dist/Queue/Workers/Worker.js +324 -0
  317. package/dist/Queue/Workers/Worker.js.map +1 -0
  318. package/dist/Queue/Workers/WorkerOptions.d.ts +62 -0
  319. package/dist/Queue/Workers/WorkerOptions.d.ts.map +1 -0
  320. package/dist/Queue/Workers/WorkerOptions.js +23 -0
  321. package/dist/Queue/Workers/WorkerOptions.js.map +1 -0
  322. package/dist/Queue/index.d.ts +41 -0
  323. package/dist/Queue/index.d.ts.map +1 -0
  324. package/dist/Queue/index.js +67 -0
  325. package/dist/Queue/index.js.map +1 -0
  326. package/dist/index.d.ts +75 -0
  327. package/dist/index.d.ts.map +1 -1
  328. package/dist/index.js +141 -2
  329. package/dist/index.js.map +1 -1
  330. package/package.json +1 -1
@@ -0,0 +1,5 @@
1
+ export type { JobMiddleware } from './JobMiddleware';
2
+ export { RateLimited } from './RateLimited';
3
+ export { WithoutOverlapping } from './WithoutOverlapping';
4
+ export { ThrottlesExceptions } from './ThrottlesExceptions';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Queue/Middleware/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThrottlesExceptions = exports.WithoutOverlapping = exports.RateLimited = void 0;
4
+ var RateLimited_1 = require("./RateLimited");
5
+ Object.defineProperty(exports, "RateLimited", { enumerable: true, get: function () { return RateLimited_1.RateLimited; } });
6
+ var WithoutOverlapping_1 = require("./WithoutOverlapping");
7
+ Object.defineProperty(exports, "WithoutOverlapping", { enumerable: true, get: function () { return WithoutOverlapping_1.WithoutOverlapping; } });
8
+ var ThrottlesExceptions_1 = require("./ThrottlesExceptions");
9
+ Object.defineProperty(exports, "ThrottlesExceptions", { enumerable: true, get: function () { return ThrottlesExceptions_1.ThrottlesExceptions; } });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Queue/Middleware/index.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * PendingChain
3
+ *
4
+ * Fluent builder for chaining multiple jobs together.
5
+ * Jobs in a chain are executed sequentially - if one fails,
6
+ * the remaining jobs in the chain are not executed.
7
+ *
8
+ * Mirrors Laravel's Illuminate\Foundation\Bus\PendingChain.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * await Bus.chain([
13
+ * new ProcessPodcast(id),
14
+ * new OptimizePodcast(id),
15
+ * new ReleasePodcast(id),
16
+ * ])
17
+ * .onConnection('redis')
18
+ * .onQueue('processing')
19
+ * .catch((error) => console.error('Chain failed:', error))
20
+ * .dispatch();
21
+ * ```
22
+ */
23
+ import type { Job } from './Job';
24
+ import type { QueueManager } from './QueueManager';
25
+ export declare class PendingChain {
26
+ protected manager: QueueManager;
27
+ protected jobs: Job[];
28
+ protected _connection?: string;
29
+ protected _queue?: string;
30
+ protected _delay?: number | Date;
31
+ protected _catchCallback?: (error: Error) => void | Promise<void>;
32
+ protected _finallyCallback?: () => void | Promise<void>;
33
+ constructor(manager: QueueManager, jobs: Job[]);
34
+ /**
35
+ * Set the connection for all jobs in the chain
36
+ */
37
+ onConnection(connection: string): this;
38
+ /**
39
+ * Set the queue for all jobs in the chain
40
+ */
41
+ onQueue(queue: string): this;
42
+ /**
43
+ * Set the delay before the first job starts
44
+ */
45
+ delay(delay: number | Date): this;
46
+ /**
47
+ * Set a callback to execute if any job in the chain fails
48
+ */
49
+ catch(callback: (error: Error) => void | Promise<void>): this;
50
+ /**
51
+ * Set a callback to execute when the chain completes (success or failure)
52
+ */
53
+ finally(callback: () => void | Promise<void>): this;
54
+ /**
55
+ * Dispatch the chain
56
+ *
57
+ * The first job is dispatched immediately. Each subsequent job
58
+ * stores the remaining chain and dispatches the next job upon
59
+ * successful completion.
60
+ */
61
+ dispatch(): Promise<string>;
62
+ }
63
+ //# sourceMappingURL=PendingChain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PendingChain.d.ts","sourceRoot":"","sources":["../../src/Queue/PendingChain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,qBAAa,YAAY;IAQrB,SAAS,CAAC,OAAO,EAAE,YAAY;IAC/B,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE;IARvB,SAAS,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,SAAS,CAAC,gBAAgB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;gBAG5C,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,GAAG,EAAE;IAGvB;;OAEG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAKtC;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK5B;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAKjC;;OAEG;IACH,KAAK,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAK7D;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAKnD;;;;;;OAMG;IACG,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;CAkClC"}
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ /**
3
+ * PendingChain
4
+ *
5
+ * Fluent builder for chaining multiple jobs together.
6
+ * Jobs in a chain are executed sequentially - if one fails,
7
+ * the remaining jobs in the chain are not executed.
8
+ *
9
+ * Mirrors Laravel's Illuminate\Foundation\Bus\PendingChain.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * await Bus.chain([
14
+ * new ProcessPodcast(id),
15
+ * new OptimizePodcast(id),
16
+ * new ReleasePodcast(id),
17
+ * ])
18
+ * .onConnection('redis')
19
+ * .onQueue('processing')
20
+ * .catch((error) => console.error('Chain failed:', error))
21
+ * .dispatch();
22
+ * ```
23
+ */
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.PendingChain = void 0;
26
+ class PendingChain {
27
+ manager;
28
+ jobs;
29
+ _connection;
30
+ _queue;
31
+ _delay;
32
+ _catchCallback;
33
+ _finallyCallback;
34
+ constructor(manager, jobs) {
35
+ this.manager = manager;
36
+ this.jobs = jobs;
37
+ }
38
+ /**
39
+ * Set the connection for all jobs in the chain
40
+ */
41
+ onConnection(connection) {
42
+ this._connection = connection;
43
+ return this;
44
+ }
45
+ /**
46
+ * Set the queue for all jobs in the chain
47
+ */
48
+ onQueue(queue) {
49
+ this._queue = queue;
50
+ return this;
51
+ }
52
+ /**
53
+ * Set the delay before the first job starts
54
+ */
55
+ delay(delay) {
56
+ this._delay = delay;
57
+ return this;
58
+ }
59
+ /**
60
+ * Set a callback to execute if any job in the chain fails
61
+ */
62
+ catch(callback) {
63
+ this._catchCallback = callback;
64
+ return this;
65
+ }
66
+ /**
67
+ * Set a callback to execute when the chain completes (success or failure)
68
+ */
69
+ finally(callback) {
70
+ this._finallyCallback = callback;
71
+ return this;
72
+ }
73
+ /**
74
+ * Dispatch the chain
75
+ *
76
+ * The first job is dispatched immediately. Each subsequent job
77
+ * stores the remaining chain and dispatches the next job upon
78
+ * successful completion.
79
+ */
80
+ async dispatch() {
81
+ if (this.jobs.length === 0) {
82
+ throw new Error('Cannot dispatch an empty chain.');
83
+ }
84
+ // Apply connection/queue to all jobs
85
+ for (const job of this.jobs) {
86
+ if (this._connection) {
87
+ job.connection = this._connection;
88
+ }
89
+ if (this._queue) {
90
+ job.queue = this._queue;
91
+ }
92
+ }
93
+ // Store chain metadata on the first job
94
+ const firstJob = this.jobs[0];
95
+ const remainingJobs = this.jobs.slice(1);
96
+ // Store chain info as serializable data
97
+ firstJob._chainJobs = remainingJobs.map((j) => ({
98
+ class: j.constructor.name,
99
+ data: j.toJSON(),
100
+ }));
101
+ firstJob._chainCatch = this._catchCallback;
102
+ firstJob._chainFinally = this._finallyCallback;
103
+ // Apply delay to first job only
104
+ if (this._delay) {
105
+ firstJob.delay = this._delay;
106
+ }
107
+ return this.manager.dispatch(firstJob);
108
+ }
109
+ }
110
+ exports.PendingChain = PendingChain;
111
+ //# sourceMappingURL=PendingChain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PendingChain.js","sourceRoot":"","sources":["../../src/Queue/PendingChain.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAKH,MAAa,YAAY;IAQX;IACA;IARF,WAAW,CAAU;IACrB,MAAM,CAAU;IAChB,MAAM,CAAiB;IACvB,cAAc,CAA0C;IACxD,gBAAgB,CAA8B;IAExD,YACY,OAAqB,EACrB,IAAW;QADX,YAAO,GAAP,OAAO,CAAc;QACrB,SAAI,GAAJ,IAAI,CAAO;IACpB,CAAC;IAEJ;;OAEG;IACH,YAAY,CAAC,UAAkB;QAC7B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,KAAa;QACnB,IAAI,CAAC,MAAM,GAAG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,CAAC,CAAC,CAAC;QACH,QAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC;QACnD,QAAgB,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAExD,gCAAgC;QAChC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAC/B,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;CACF;AA7FD,oCA6FC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * PendingDispatch
3
+ *
4
+ * Provides a fluent interface for configuring job dispatch.
5
+ * Mirrors Laravel's Illuminate\Foundation\Bus\PendingDispatch.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * await ProcessPodcast.dispatch(podcastId)
10
+ * .onConnection('redis')
11
+ * .onQueue('processing')
12
+ * .delay(60);
13
+ *
14
+ * // The dispatch happens when the PendingDispatch is awaited
15
+ * // or when .dispatch() is explicitly called
16
+ * ```
17
+ */
18
+ import type { Job } from './Job';
19
+ import type { QueueManager } from './QueueManager';
20
+ export declare class PendingDispatch implements PromiseLike<string> {
21
+ protected manager: QueueManager;
22
+ protected job: Job;
23
+ protected _afterCommit: boolean;
24
+ constructor(manager: QueueManager, job: Job);
25
+ /**
26
+ * Set the desired connection for the job
27
+ */
28
+ onConnection(connection: string): this;
29
+ /**
30
+ * Set the desired queue for the job
31
+ */
32
+ onQueue(queue: string): this;
33
+ /**
34
+ * Set the delay for the job
35
+ */
36
+ delay(delay: number | Date): this;
37
+ /**
38
+ * Set the number of times the job may be attempted
39
+ */
40
+ tries(tries: number): this;
41
+ /**
42
+ * Set the timeout for the job
43
+ */
44
+ timeout(timeout: number): this;
45
+ /**
46
+ * Set the backoff strategy for the job
47
+ */
48
+ backoff(backoff: number | number[]): this;
49
+ /**
50
+ * Indicate that the job should be dispatched after all DB transactions commit
51
+ */
52
+ afterCommit(): this;
53
+ /**
54
+ * Indicate that the job should not wait for DB transactions
55
+ */
56
+ beforeCommit(): this;
57
+ /**
58
+ * Dispatch the job to the queue
59
+ */
60
+ dispatch(): Promise<string>;
61
+ /**
62
+ * PromiseLike implementation - allows `await ProcessPodcast.dispatch(id)`
63
+ */
64
+ then<TResult1 = string, TResult2 = never>(onfulfilled?: ((value: string) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
65
+ }
66
+ //# sourceMappingURL=PendingDispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PendingDispatch.d.ts","sourceRoot":"","sources":["../../src/Queue/PendingDispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,qBAAa,eAAgB,YAAW,WAAW,CAAC,MAAM,CAAC;IAIvD,SAAS,CAAC,OAAO,EAAE,YAAY;IAC/B,SAAS,CAAC,GAAG,EAAE,GAAG;IAJpB,SAAS,CAAC,YAAY,EAAE,OAAO,CAAS;gBAG5B,OAAO,EAAE,YAAY,EACrB,GAAG,EAAE,GAAG;IAGpB;;OAEG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAKtC;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK5B;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAKjC;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK1B;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK9B;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAKzC;;OAEG;IACH,WAAW,IAAI,IAAI;IAMnB;;OAEG;IACH,YAAY,IAAI,IAAI;IAMpB;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAIjC;;OAEG;IACH,IAAI,CAAC,QAAQ,GAAG,MAAM,EAAE,QAAQ,GAAG,KAAK,EACtC,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,EAC1E,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,GACtE,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAC;CAGpC"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ /**
3
+ * PendingDispatch
4
+ *
5
+ * Provides a fluent interface for configuring job dispatch.
6
+ * Mirrors Laravel's Illuminate\Foundation\Bus\PendingDispatch.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * await ProcessPodcast.dispatch(podcastId)
11
+ * .onConnection('redis')
12
+ * .onQueue('processing')
13
+ * .delay(60);
14
+ *
15
+ * // The dispatch happens when the PendingDispatch is awaited
16
+ * // or when .dispatch() is explicitly called
17
+ * ```
18
+ */
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.PendingDispatch = void 0;
21
+ class PendingDispatch {
22
+ manager;
23
+ job;
24
+ _afterCommit = false;
25
+ constructor(manager, job) {
26
+ this.manager = manager;
27
+ this.job = job;
28
+ }
29
+ /**
30
+ * Set the desired connection for the job
31
+ */
32
+ onConnection(connection) {
33
+ this.job.connection = connection;
34
+ return this;
35
+ }
36
+ /**
37
+ * Set the desired queue for the job
38
+ */
39
+ onQueue(queue) {
40
+ this.job.queue = queue;
41
+ return this;
42
+ }
43
+ /**
44
+ * Set the delay for the job
45
+ */
46
+ delay(delay) {
47
+ this.job.delay = delay;
48
+ return this;
49
+ }
50
+ /**
51
+ * Set the number of times the job may be attempted
52
+ */
53
+ tries(tries) {
54
+ this.job.tries = tries;
55
+ return this;
56
+ }
57
+ /**
58
+ * Set the timeout for the job
59
+ */
60
+ timeout(timeout) {
61
+ this.job.timeout = timeout;
62
+ return this;
63
+ }
64
+ /**
65
+ * Set the backoff strategy for the job
66
+ */
67
+ backoff(backoff) {
68
+ this.job.backoff = backoff;
69
+ return this;
70
+ }
71
+ /**
72
+ * Indicate that the job should be dispatched after all DB transactions commit
73
+ */
74
+ afterCommit() {
75
+ this._afterCommit = true;
76
+ this.job.afterCommit = true;
77
+ return this;
78
+ }
79
+ /**
80
+ * Indicate that the job should not wait for DB transactions
81
+ */
82
+ beforeCommit() {
83
+ this._afterCommit = false;
84
+ this.job.afterCommit = false;
85
+ return this;
86
+ }
87
+ /**
88
+ * Dispatch the job to the queue
89
+ */
90
+ async dispatch() {
91
+ return this.manager.dispatch(this.job);
92
+ }
93
+ /**
94
+ * PromiseLike implementation - allows `await ProcessPodcast.dispatch(id)`
95
+ */
96
+ then(onfulfilled, onrejected) {
97
+ return this.dispatch().then(onfulfilled, onrejected);
98
+ }
99
+ }
100
+ exports.PendingDispatch = PendingDispatch;
101
+ //# sourceMappingURL=PendingDispatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PendingDispatch.js","sourceRoot":"","sources":["../../src/Queue/PendingDispatch.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAKH,MAAa,eAAe;IAId;IACA;IAJF,YAAY,GAAY,KAAK,CAAC;IAExC,YACY,OAAqB,EACrB,GAAQ;QADR,YAAO,GAAP,OAAO,CAAc;QACrB,QAAG,GAAH,GAAG,CAAK;IACjB,CAAC;IAEJ;;OAEG;IACH,YAAY,CAAC,UAAkB;QAC7B,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;I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151 @@
1
+ /**
2
+ * QueueManager
3
+ *
4
+ * Manages multiple queue connections and drivers.
5
+ * Follows the same Manager pattern as DatabaseManager.
6
+ *
7
+ * Mirrors Laravel's Illuminate\Queue\QueueManager.
8
+ */
9
+ import type { QueueDriver } from './Contracts/QueueDriver';
10
+ import type { Job } from './Job';
11
+ export interface QueueConnectionConfig {
12
+ driver: string;
13
+ connection?: string;
14
+ table?: string;
15
+ queue?: string;
16
+ retry_after?: number;
17
+ block_for?: number | null;
18
+ after_commit?: boolean;
19
+ [key: string]: any;
20
+ }
21
+ export interface QueueFailedConfig {
22
+ driver: string;
23
+ database?: string;
24
+ table?: string;
25
+ }
26
+ export interface QueueBatchingConfig {
27
+ database: string;
28
+ table: string;
29
+ }
30
+ export interface QueueConfig {
31
+ default: string;
32
+ connections: Record<string, QueueConnectionConfig>;
33
+ batching?: QueueBatchingConfig;
34
+ failed?: QueueFailedConfig;
35
+ }
36
+ export type DriverFactory = (config: QueueConnectionConfig) => QueueDriver;
37
+ export declare class QueueManager {
38
+ protected config: QueueConfig;
39
+ protected connections: Map<string, QueueDriver>;
40
+ protected driverFactories: Map<string, DriverFactory>;
41
+ protected jobRegistry: Map<string, new (...args: any[]) => Job>;
42
+ /**
43
+ * Event callbacks
44
+ */
45
+ protected beforeCallbacks: Array<(connectionName: string, job: Job) => void>;
46
+ protected afterCallbacks: Array<(connectionName: string, job: Job) => void>;
47
+ protected failingCallbacks: Array<(connectionName: string, job: Job, error: Error) => void>;
48
+ protected loopingCallbacks: Array<() => void>;
49
+ constructor(config: QueueConfig);
50
+ /**
51
+ * Register a queue driver factory
52
+ */
53
+ registerDriver(name: string, factory: DriverFactory): void;
54
+ /**
55
+ * Register a job class for deserialization
56
+ */
57
+ registerJob(name: string, jobClass: new (...args: any[]) => Job): void;
58
+ /**
59
+ * Get a job class from the registry
60
+ */
61
+ getJobClass(name: string): (new (...args: any[]) => Job) | undefined;
62
+ /**
63
+ * Get a queue connection instance
64
+ */
65
+ connection(name?: string): QueueDriver;
66
+ /**
67
+ * Create a new queue connection
68
+ */
69
+ protected createConnection(name: string): QueueDriver;
70
+ /**
71
+ * Dispatch a job to its configured connection and queue
72
+ */
73
+ dispatch(job: Job): Promise<string>;
74
+ /**
75
+ * Dispatch a job synchronously (bypass queue, execute immediately)
76
+ */
77
+ dispatchSync(job: Job): Promise<void>;
78
+ /**
79
+ * Push a job onto a specific queue
80
+ */
81
+ push(job: Job, queue?: string): Promise<string>;
82
+ /**
83
+ * Push a job onto a specific named queue
84
+ */
85
+ pushOn(queue: string, job: Job): Promise<string>;
86
+ /**
87
+ * Push a job after a delay
88
+ */
89
+ later(delay: number | Date, job: Job, queue?: string): Promise<string>;
90
+ /**
91
+ * Push multiple jobs onto the queue
92
+ */
93
+ bulk(jobs: Job[], queue?: string): Promise<void>;
94
+ /**
95
+ * Register a callback to be called before a job is processed
96
+ */
97
+ before(callback: (connectionName: string, job: Job) => void): void;
98
+ /**
99
+ * Register a callback to be called after a job is processed
100
+ */
101
+ after(callback: (connectionName: string, job: Job) => void): void;
102
+ /**
103
+ * Register a callback to be called when a job fails
104
+ */
105
+ failing(callback: (connectionName: string, job: Job, error: Error) => void): void;
106
+ /**
107
+ * Register a callback to be called on each worker loop iteration
108
+ */
109
+ looping(callback: () => void): void;
110
+ /**
111
+ * Fire the before job callbacks
112
+ */
113
+ fireBeforeCallbacks(connectionName: string, job: Job): void;
114
+ /**
115
+ * Fire the after job callbacks
116
+ */
117
+ fireAfterCallbacks(connectionName: string, job: Job): void;
118
+ /**
119
+ * Fire the failing job callbacks
120
+ */
121
+ fireFailingCallbacks(connectionName: string, job: Job, error: Error): void;
122
+ /**
123
+ * Fire the looping callbacks
124
+ */
125
+ fireLoopingCallbacks(): void;
126
+ /**
127
+ * Disconnect from a queue connection
128
+ */
129
+ disconnect(name?: string): void;
130
+ /**
131
+ * Get the default connection name
132
+ */
133
+ getDefaultConnection(): string;
134
+ /**
135
+ * Set the default connection name
136
+ */
137
+ setDefaultConnection(name: string): void;
138
+ /**
139
+ * Get all connection names
140
+ */
141
+ getConnections(): string[];
142
+ /**
143
+ * Get the queue configuration
144
+ */
145
+ getConfig(): QueueConfig;
146
+ /**
147
+ * Get the connection configuration
148
+ */
149
+ getConnectionConfig(name?: string): QueueConnectionConfig;
150
+ }
151
+ //# sourceMappingURL=QueueManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueueManager.d.ts","sourceRoot":"","sources":["../../src/Queue/QueueManager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IACnD,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,MAAM,aAAa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