@fncts/io 0.0.49 → 0.0.51

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 (635) hide show
  1. package/Channel/internal/SingleProducerAsyncInput.d.ts +1 -1
  2. package/CountdownLatch.d.ts +5 -5
  3. package/Fiber/FiberRuntime.d.ts +1 -1
  4. package/Hub/api.d.ts +7 -7
  5. package/IO/api/foreachExec.d.ts +18 -0
  6. package/IO/api.d.ts +1 -1
  7. package/Push/Bounds.d.ts +4 -0
  8. package/Push/FlattenStrategy.d.ts +47 -0
  9. package/Push/IndexedBuffer.d.ts +19 -0
  10. package/Push/MergeStrategy.d.ts +19 -0
  11. package/Push/Operator/IOLoopOperator.d.ts +61 -0
  12. package/Push/Operator/IOOperator.d.ts +63 -0
  13. package/Push/Operator/LoopOperator.d.ts +50 -0
  14. package/Push/Operator/SyncOperator.d.ts +41 -0
  15. package/Push/Operator.d.ts +4 -0
  16. package/Push/Producer/IOProducer.d.ts +41 -0
  17. package/Push/Producer/SyncProducer.d.ts +61 -0
  18. package/Push/Producer.d.ts +1 -0
  19. package/Push/Sink.d.ts +65 -0
  20. package/Push/api.d.ts +80 -163
  21. package/Push/definition.d.ts +92 -19
  22. package/Push/internal.d.ts +3 -0
  23. package/Push.d.ts +6 -0
  24. package/Queue/api/dimapIO.d.ts +12 -12
  25. package/Ref/Synchronized/definition.d.ts +32 -9
  26. package/Ref/definition.d.ts +12 -0
  27. package/STM/api.d.ts +1 -1
  28. package/Scope/api.d.ts +16 -1
  29. package/Semaphore/definition.d.ts +1 -1
  30. package/Sink/definition.d.ts +5 -6
  31. package/Subject/Atomic.d.ts +19 -9
  32. package/Subject/DeferredRef.d.ts +17 -0
  33. package/Subject/Hold.d.ts +19 -0
  34. package/Subject/RefSubject/Atomic.d.ts +43 -0
  35. package/Subject/RefSubject/Derived.d.ts +43 -0
  36. package/Subject/RefSubject/RefSubject.d.ts +37 -0
  37. package/Subject/RefSubject/constructors.d.ts +15 -0
  38. package/Subject/RefSubject.d.ts +4 -0
  39. package/Subject/definition.d.ts +14 -2
  40. package/Subject.d.ts +3 -0
  41. package/SubscriptionRef.d.ts +0 -1
  42. package/Supervisor/definition.d.ts +1 -1
  43. package/_cjs/Cached/api.cjs +8 -2
  44. package/_cjs/Cached/api.cjs.map +1 -1
  45. package/_cjs/Cached/definition.cjs +2 -6
  46. package/_cjs/Cached/definition.cjs.map +1 -1
  47. package/_cjs/CancellerState.cjs +4 -7
  48. package/_cjs/CancellerState.cjs.map +1 -1
  49. package/_cjs/Channel/UpstreamPullRequest/definition.cjs +4 -2
  50. package/_cjs/Channel/UpstreamPullRequest/definition.cjs.map +1 -1
  51. package/_cjs/Channel/api.cjs +2 -3
  52. package/_cjs/Channel/api.cjs.map +1 -1
  53. package/_cjs/Channel/definition.cjs +22 -16
  54. package/_cjs/Channel/definition.cjs.map +1 -1
  55. package/_cjs/Channel/internal/ChannelExecutor.cjs +35 -11
  56. package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
  57. package/_cjs/Channel/internal/ChannelState.cjs +15 -8
  58. package/_cjs/Channel/internal/ChannelState.cjs.map +1 -1
  59. package/_cjs/Channel/internal/MergeDecision.cjs +6 -8
  60. package/_cjs/Channel/internal/MergeDecision.cjs.map +1 -1
  61. package/_cjs/Channel/internal/MergeState.cjs +7 -3
  62. package/_cjs/Channel/internal/MergeState.cjs.map +1 -1
  63. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +49 -42
  64. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
  65. package/_cjs/Clock/live.cjs +1 -4
  66. package/_cjs/Clock/live.cjs.map +1 -1
  67. package/_cjs/CountdownLatch.cjs +22 -12
  68. package/_cjs/CountdownLatch.cjs.map +1 -1
  69. package/_cjs/Differ/api.cjs +3 -12
  70. package/_cjs/Differ/api.cjs.map +1 -1
  71. package/_cjs/Differ/definition.cjs +1 -5
  72. package/_cjs/Differ/definition.cjs.map +1 -1
  73. package/_cjs/Fiber/FiberMessage.cjs +6 -3
  74. package/_cjs/Fiber/FiberMessage.cjs.map +1 -1
  75. package/_cjs/Fiber/FiberRuntime.cjs +66 -61
  76. package/_cjs/Fiber/FiberRuntime.cjs.map +1 -1
  77. package/_cjs/Fiber/definition.cjs +10 -6
  78. package/_cjs/Fiber/definition.cjs.map +1 -1
  79. package/_cjs/FiberDescriptor.cjs +3 -0
  80. package/_cjs/FiberDescriptor.cjs.map +1 -1
  81. package/_cjs/FiberRef/definition.cjs +9 -6
  82. package/_cjs/FiberRef/definition.cjs.map +1 -1
  83. package/_cjs/FiberRefs/Patch.cjs +13 -13
  84. package/_cjs/FiberRefs/Patch.cjs.map +1 -1
  85. package/_cjs/FiberScope/definition.cjs +2 -0
  86. package/_cjs/FiberScope/definition.cjs.map +1 -1
  87. package/_cjs/FiberSet.cjs +4 -3
  88. package/_cjs/FiberSet.cjs.map +1 -1
  89. package/_cjs/FiberStatus/definition.cjs +12 -9
  90. package/_cjs/FiberStatus/definition.cjs.map +1 -1
  91. package/_cjs/Future/State.cjs +8 -7
  92. package/_cjs/Future/State.cjs.map +1 -1
  93. package/_cjs/Future/definition.cjs +3 -3
  94. package/_cjs/Future/definition.cjs.map +1 -1
  95. package/_cjs/Hub/api.cjs +61 -44
  96. package/_cjs/Hub/api.cjs.map +1 -1
  97. package/_cjs/Hub/definition.cjs +4 -8
  98. package/_cjs/Hub/definition.cjs.map +1 -1
  99. package/_cjs/Hub/internal.cjs +130 -110
  100. package/_cjs/Hub/internal.cjs.map +1 -1
  101. package/_cjs/IO/api/foreachExec.cjs +29 -4
  102. package/_cjs/IO/api/foreachExec.cjs.map +1 -1
  103. package/_cjs/IO/api/transplant.cjs +8 -7
  104. package/_cjs/IO/api/transplant.cjs.map +1 -1
  105. package/_cjs/IO/api.cjs +9 -4
  106. package/_cjs/IO/api.cjs.map +1 -1
  107. package/_cjs/IO/definition.cjs +8 -12
  108. package/_cjs/IO/definition.cjs.map +1 -1
  109. package/_cjs/IO/runtime.cjs +64 -61
  110. package/_cjs/IO/runtime.cjs.map +1 -1
  111. package/_cjs/InterruptStatus/definition.cjs +1 -0
  112. package/_cjs/InterruptStatus/definition.cjs.map +1 -1
  113. package/_cjs/Layer/MemoMap.cjs +25 -24
  114. package/_cjs/Layer/MemoMap.cjs.map +1 -1
  115. package/_cjs/Layer/definition.cjs +30 -13
  116. package/_cjs/Layer/definition.cjs.map +1 -1
  117. package/_cjs/LogLevel.cjs +3 -0
  118. package/_cjs/LogLevel.cjs.map +1 -1
  119. package/_cjs/LogSpan.cjs +2 -0
  120. package/_cjs/LogSpan.cjs.map +1 -1
  121. package/_cjs/Logger/definition.cjs +1 -0
  122. package/_cjs/Logger/definition.cjs.map +1 -1
  123. package/_cjs/MVar/definition.cjs +3 -4
  124. package/_cjs/MVar/definition.cjs.map +1 -1
  125. package/_cjs/Push/Bounds.cjs +2 -0
  126. package/_cjs/Push/Bounds.cjs.map +1 -0
  127. package/_cjs/Push/FlattenStrategy.cjs +96 -0
  128. package/_cjs/Push/FlattenStrategy.cjs.map +1 -0
  129. package/_cjs/Push/IndexedBuffer.cjs +74 -0
  130. package/_cjs/Push/IndexedBuffer.cjs.map +1 -0
  131. package/_cjs/Push/MergeStrategy.cjs +47 -0
  132. package/_cjs/Push/MergeStrategy.cjs.map +1 -0
  133. package/_cjs/Push/Operator/IOLoopOperator.cjs +225 -0
  134. package/_cjs/Push/Operator/IOLoopOperator.cjs.map +1 -0
  135. package/_cjs/Push/Operator/IOOperator.cjs +104 -0
  136. package/_cjs/Push/Operator/IOOperator.cjs.map +1 -0
  137. package/_cjs/Push/Operator/LoopOperator.cjs +165 -0
  138. package/_cjs/Push/Operator/LoopOperator.cjs.map +1 -0
  139. package/_cjs/Push/Operator/SyncOperator.cjs +78 -0
  140. package/_cjs/Push/Operator/SyncOperator.cjs.map +1 -0
  141. package/_cjs/Push/Operator.cjs +2 -0
  142. package/_cjs/Push/Operator.cjs.map +1 -0
  143. package/_cjs/Push/Producer/IOProducer.cjs +72 -0
  144. package/_cjs/Push/Producer/IOProducer.cjs.map +1 -0
  145. package/_cjs/Push/Producer/SyncProducer.cjs +111 -0
  146. package/_cjs/Push/Producer/SyncProducer.cjs.map +1 -0
  147. package/_cjs/Push/Producer.cjs +2 -0
  148. package/_cjs/Push/Producer.cjs.map +1 -0
  149. package/_cjs/Push/Sink.cjs +238 -0
  150. package/_cjs/Push/Sink.cjs.map +1 -0
  151. package/_cjs/Push/api.cjs +369 -387
  152. package/_cjs/Push/api.cjs.map +1 -1
  153. package/_cjs/Push/definition.cjs +82 -26
  154. package/_cjs/Push/definition.cjs.map +1 -1
  155. package/_cjs/Push/internal.cjs +31 -26
  156. package/_cjs/Push/internal.cjs.map +1 -1
  157. package/_cjs/Push.cjs +66 -0
  158. package/_cjs/Push.cjs.map +1 -1
  159. package/_cjs/Queue/api/dimapIO.cjs +74 -32
  160. package/_cjs/Queue/api/dimapIO.cjs.map +1 -1
  161. package/_cjs/Queue/api/filterInputIO.cjs +51 -25
  162. package/_cjs/Queue/api/filterInputIO.cjs.map +1 -1
  163. package/_cjs/Queue/api/filterOutputIO.cjs +60 -30
  164. package/_cjs/Queue/api/filterOutputIO.cjs.map +1 -1
  165. package/_cjs/Queue/api/zipWithIO.cjs +27 -10
  166. package/_cjs/Queue/api/zipWithIO.cjs.map +1 -1
  167. package/_cjs/Queue/definition.cjs +3 -7
  168. package/_cjs/Queue/definition.cjs.map +1 -1
  169. package/_cjs/Queue/internal.cjs +73 -62
  170. package/_cjs/Queue/internal.cjs.map +1 -1
  171. package/_cjs/Queue/strategy.cjs +1 -3
  172. package/_cjs/Queue/strategy.cjs.map +1 -1
  173. package/_cjs/Random/live.cjs +4 -3
  174. package/_cjs/Random/live.cjs.map +1 -1
  175. package/_cjs/Ref/Atomic.cjs +2 -3
  176. package/_cjs/Ref/Atomic.cjs.map +1 -1
  177. package/_cjs/Ref/Derived.cjs +2 -3
  178. package/_cjs/Ref/Derived.cjs.map +1 -1
  179. package/_cjs/Ref/DerivedAll.cjs +2 -3
  180. package/_cjs/Ref/DerivedAll.cjs.map +1 -1
  181. package/_cjs/Ref/Synchronized/definition.cjs +17 -16
  182. package/_cjs/Ref/Synchronized/definition.cjs.map +1 -1
  183. package/_cjs/Ref/definition.cjs +2 -6
  184. package/_cjs/Ref/definition.cjs.map +1 -1
  185. package/_cjs/Reloadable/definition.cjs +2 -0
  186. package/_cjs/Reloadable/definition.cjs.map +1 -1
  187. package/_cjs/STM/definition.cjs +30 -25
  188. package/_cjs/STM/definition.cjs.map +1 -1
  189. package/_cjs/STM/driver.cjs +5 -0
  190. package/_cjs/STM/driver.cjs.map +1 -1
  191. package/_cjs/STM/internal/Entry.cjs +9 -6
  192. package/_cjs/STM/internal/Entry.cjs.map +1 -1
  193. package/_cjs/STM/internal/TryCommit.cjs +6 -7
  194. package/_cjs/STM/internal/TryCommit.cjs.map +1 -1
  195. package/_cjs/STM/internal/Versioned.cjs +2 -3
  196. package/_cjs/STM/internal/Versioned.cjs.map +1 -1
  197. package/_cjs/Schedule/Decision.cjs +3 -4
  198. package/_cjs/Schedule/Decision.cjs.map +1 -1
  199. package/_cjs/Schedule/Driver.cjs +4 -0
  200. package/_cjs/Schedule/Driver.cjs.map +1 -1
  201. package/_cjs/Schedule/api.cjs +2 -5
  202. package/_cjs/Schedule/api.cjs.map +1 -1
  203. package/_cjs/Schedule/definition.cjs +3 -1
  204. package/_cjs/Schedule/definition.cjs.map +1 -1
  205. package/_cjs/Scope/ReleaseMap/definition.cjs +8 -2
  206. package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
  207. package/_cjs/Scope/api.cjs +29 -11
  208. package/_cjs/Scope/api.cjs.map +1 -1
  209. package/_cjs/Scope/definition.cjs +3 -7
  210. package/_cjs/Scope/definition.cjs.map +1 -1
  211. package/_cjs/ScopedRef/api.cjs +8 -3
  212. package/_cjs/ScopedRef/api.cjs.map +1 -1
  213. package/_cjs/ScopedRef/definition.cjs +1 -5
  214. package/_cjs/ScopedRef/definition.cjs.map +1 -1
  215. package/_cjs/Semaphore/Reservation.cjs +2 -0
  216. package/_cjs/Semaphore/Reservation.cjs.map +1 -1
  217. package/_cjs/Semaphore/definition.cjs +42 -38
  218. package/_cjs/Semaphore/definition.cjs.map +1 -1
  219. package/_cjs/Sink/definition.cjs +3 -3
  220. package/_cjs/Sink/definition.cjs.map +1 -1
  221. package/_cjs/State/api.cjs +1 -4
  222. package/_cjs/State/api.cjs.map +1 -1
  223. package/_cjs/State/definition.cjs +2 -6
  224. package/_cjs/State/definition.cjs.map +1 -1
  225. package/_cjs/State/internal.cjs +1 -5
  226. package/_cjs/State/internal.cjs.map +1 -1
  227. package/_cjs/Stream/api/zipAllWith.cjs +7 -11
  228. package/_cjs/Stream/api/zipAllWith.cjs.map +1 -1
  229. package/_cjs/Stream/api/zipWithChunks.cjs +5 -5
  230. package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -1
  231. package/_cjs/Stream/api.cjs +8 -7
  232. package/_cjs/Stream/api.cjs.map +1 -1
  233. package/_cjs/Stream/definition.cjs +3 -4
  234. package/_cjs/Stream/definition.cjs.map +1 -1
  235. package/_cjs/Stream/internal/DebounceState.cjs +5 -5
  236. package/_cjs/Stream/internal/DebounceState.cjs.map +1 -1
  237. package/_cjs/Stream/internal/Handoff.cjs +18 -17
  238. package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
  239. package/_cjs/Stream/internal/SinkEndReason.cjs +5 -12
  240. package/_cjs/Stream/internal/SinkEndReason.cjs.map +1 -1
  241. package/_cjs/Stream/internal/Take.cjs +3 -0
  242. package/_cjs/Stream/internal/Take.cjs.map +1 -1
  243. package/_cjs/Subject/Atomic.cjs +45 -15
  244. package/_cjs/Subject/Atomic.cjs.map +1 -1
  245. package/_cjs/Subject/DeferredRef.cjs +56 -0
  246. package/_cjs/Subject/DeferredRef.cjs.map +1 -0
  247. package/_cjs/Subject/Hold.cjs +38 -0
  248. package/_cjs/Subject/Hold.cjs.map +1 -0
  249. package/_cjs/Subject/RefSubject/Atomic.cjs +171 -0
  250. package/_cjs/Subject/RefSubject/Atomic.cjs.map +1 -0
  251. package/_cjs/Subject/RefSubject/Derived.cjs +103 -0
  252. package/_cjs/Subject/RefSubject/Derived.cjs.map +1 -0
  253. package/_cjs/Subject/RefSubject/RefSubject.cjs +18 -0
  254. package/_cjs/Subject/RefSubject/RefSubject.cjs.map +1 -0
  255. package/_cjs/Subject/RefSubject/constructors.cjs +30 -0
  256. package/_cjs/Subject/RefSubject/constructors.cjs.map +1 -0
  257. package/_cjs/Subject/RefSubject.cjs +2 -0
  258. package/_cjs/Subject/RefSubject.cjs.map +1 -0
  259. package/_cjs/Subject/definition.cjs +11 -1
  260. package/_cjs/Subject/definition.cjs.map +1 -1
  261. package/_cjs/Subject.cjs +33 -0
  262. package/_cjs/Subject.cjs.map +1 -1
  263. package/_cjs/SubscriptionRef.cjs +4 -5
  264. package/_cjs/SubscriptionRef.cjs.map +1 -1
  265. package/_cjs/Supervisor/constructors.cjs +3 -11
  266. package/_cjs/Supervisor/constructors.cjs.map +1 -1
  267. package/_cjs/Supervisor/definition.cjs +10 -4
  268. package/_cjs/Supervisor/definition.cjs.map +1 -1
  269. package/_cjs/SupervisorPatch.cjs +9 -12
  270. package/_cjs/SupervisorPatch.cjs.map +1 -1
  271. package/_cjs/TExit/definition.cjs +19 -18
  272. package/_cjs/TExit/definition.cjs.map +1 -1
  273. package/_cjs/TReentrantLock/definition.cjs +8 -3
  274. package/_cjs/TReentrantLock/definition.cjs.map +1 -1
  275. package/_cjs/TRef/definition.cjs +6 -6
  276. package/_cjs/TRef/definition.cjs.map +1 -1
  277. package/_cjs/internal/BackgroundScheduler.cjs +16 -16
  278. package/_cjs/internal/BackgroundScheduler.cjs.map +1 -1
  279. package/_cjs/internal/HashedPair.cjs +2 -0
  280. package/_cjs/internal/HashedPair.cjs.map +1 -1
  281. package/_cjs/internal/Hub.cjs +39 -15
  282. package/_cjs/internal/Hub.cjs.map +1 -1
  283. package/_cjs/internal/IsFatal.cjs +7 -11
  284. package/_cjs/internal/IsFatal.cjs.map +1 -1
  285. package/_cjs/internal/MutableQueue.cjs +14 -11
  286. package/_cjs/internal/MutableQueue.cjs.map +1 -1
  287. package/_cjs/internal/Scheduler.cjs +4 -8
  288. package/_cjs/internal/Scheduler.cjs.map +1 -1
  289. package/_cjs/internal/StackTraceBuilder.cjs +2 -4
  290. package/_cjs/internal/StackTraceBuilder.cjs.map +1 -1
  291. package/_mjs/Cached/api.mjs +8 -2
  292. package/_mjs/Cached/api.mjs.map +1 -1
  293. package/_mjs/Cached/definition.mjs +1 -5
  294. package/_mjs/Cached/definition.mjs.map +1 -1
  295. package/_mjs/CancellerState.mjs +4 -7
  296. package/_mjs/CancellerState.mjs.map +1 -1
  297. package/_mjs/Channel/UpstreamPullRequest/definition.mjs +4 -2
  298. package/_mjs/Channel/UpstreamPullRequest/definition.mjs.map +1 -1
  299. package/_mjs/Channel/api.mjs +2 -3
  300. package/_mjs/Channel/api.mjs.map +1 -1
  301. package/_mjs/Channel/definition.mjs +21 -15
  302. package/_mjs/Channel/definition.mjs.map +1 -1
  303. package/_mjs/Channel/internal/ChannelExecutor.mjs +35 -11
  304. package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
  305. package/_mjs/Channel/internal/ChannelState.mjs +15 -8
  306. package/_mjs/Channel/internal/ChannelState.mjs.map +1 -1
  307. package/_mjs/Channel/internal/MergeDecision.mjs +5 -7
  308. package/_mjs/Channel/internal/MergeDecision.mjs.map +1 -1
  309. package/_mjs/Channel/internal/MergeState.mjs +7 -3
  310. package/_mjs/Channel/internal/MergeState.mjs.map +1 -1
  311. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs +49 -42
  312. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs.map +1 -1
  313. package/_mjs/Clock/live.mjs +1 -4
  314. package/_mjs/Clock/live.mjs.map +1 -1
  315. package/_mjs/CountdownLatch.mjs +21 -11
  316. package/_mjs/CountdownLatch.mjs.map +1 -1
  317. package/_mjs/Differ/api.mjs +3 -12
  318. package/_mjs/Differ/api.mjs.map +1 -1
  319. package/_mjs/Differ/definition.mjs +1 -5
  320. package/_mjs/Differ/definition.mjs.map +1 -1
  321. package/_mjs/Fiber/FiberMessage.mjs +6 -3
  322. package/_mjs/Fiber/FiberMessage.mjs.map +1 -1
  323. package/_mjs/Fiber/FiberRuntime.mjs +66 -61
  324. package/_mjs/Fiber/FiberRuntime.mjs.map +1 -1
  325. package/_mjs/Fiber/definition.mjs +9 -5
  326. package/_mjs/Fiber/definition.mjs.map +1 -1
  327. package/_mjs/FiberDescriptor.mjs +3 -0
  328. package/_mjs/FiberDescriptor.mjs.map +1 -1
  329. package/_mjs/FiberRef/definition.mjs +9 -6
  330. package/_mjs/FiberRef/definition.mjs.map +1 -1
  331. package/_mjs/FiberRefs/Patch.mjs +13 -13
  332. package/_mjs/FiberRefs/Patch.mjs.map +1 -1
  333. package/_mjs/FiberScope/definition.mjs +2 -0
  334. package/_mjs/FiberScope/definition.mjs.map +1 -1
  335. package/_mjs/FiberSet.mjs +4 -3
  336. package/_mjs/FiberSet.mjs.map +1 -1
  337. package/_mjs/FiberStatus/definition.mjs +12 -9
  338. package/_mjs/FiberStatus/definition.mjs.map +1 -1
  339. package/_mjs/Future/State.mjs +8 -7
  340. package/_mjs/Future/State.mjs.map +1 -1
  341. package/_mjs/Future/definition.mjs +3 -3
  342. package/_mjs/Future/definition.mjs.map +1 -1
  343. package/_mjs/Hub/api.mjs +61 -44
  344. package/_mjs/Hub/api.mjs.map +1 -1
  345. package/_mjs/Hub/definition.mjs +3 -7
  346. package/_mjs/Hub/definition.mjs.map +1 -1
  347. package/_mjs/Hub/internal.mjs +130 -110
  348. package/_mjs/Hub/internal.mjs.map +1 -1
  349. package/_mjs/IO/api/foreachExec.mjs +27 -4
  350. package/_mjs/IO/api/foreachExec.mjs.map +1 -1
  351. package/_mjs/IO/api/transplant.mjs +8 -7
  352. package/_mjs/IO/api/transplant.mjs.map +1 -1
  353. package/_mjs/IO/api.mjs +9 -4
  354. package/_mjs/IO/api.mjs.map +1 -1
  355. package/_mjs/IO/definition.mjs +7 -11
  356. package/_mjs/IO/definition.mjs.map +1 -1
  357. package/_mjs/IO/runtime.mjs +64 -61
  358. package/_mjs/IO/runtime.mjs.map +1 -1
  359. package/_mjs/InterruptStatus/definition.mjs +1 -0
  360. package/_mjs/InterruptStatus/definition.mjs.map +1 -1
  361. package/_mjs/Layer/MemoMap.mjs +25 -24
  362. package/_mjs/Layer/MemoMap.mjs.map +1 -1
  363. package/_mjs/Layer/definition.mjs +29 -12
  364. package/_mjs/Layer/definition.mjs.map +1 -1
  365. package/_mjs/LogLevel.mjs +3 -0
  366. package/_mjs/LogLevel.mjs.map +1 -1
  367. package/_mjs/LogSpan.mjs +2 -0
  368. package/_mjs/LogSpan.mjs.map +1 -1
  369. package/_mjs/Logger/definition.mjs +1 -0
  370. package/_mjs/Logger/definition.mjs.map +1 -1
  371. package/_mjs/MVar/definition.mjs +2 -3
  372. package/_mjs/MVar/definition.mjs.map +1 -1
  373. package/_mjs/Push/Bounds.mjs +2 -0
  374. package/_mjs/Push/Bounds.mjs.map +1 -0
  375. package/_mjs/Push/FlattenStrategy.mjs +87 -0
  376. package/_mjs/Push/FlattenStrategy.mjs.map +1 -0
  377. package/_mjs/Push/IndexedBuffer.mjs +65 -0
  378. package/_mjs/Push/IndexedBuffer.mjs.map +1 -0
  379. package/_mjs/Push/MergeStrategy.mjs +36 -0
  380. package/_mjs/Push/MergeStrategy.mjs.map +1 -0
  381. package/_mjs/Push/Operator/IOLoopOperator.mjs +208 -0
  382. package/_mjs/Push/Operator/IOLoopOperator.mjs.map +1 -0
  383. package/_mjs/Push/Operator/IOOperator.mjs +91 -0
  384. package/_mjs/Push/Operator/IOOperator.mjs.map +1 -0
  385. package/_mjs/Push/Operator/LoopOperator.mjs +151 -0
  386. package/_mjs/Push/Operator/LoopOperator.mjs.map +1 -0
  387. package/_mjs/Push/Operator/SyncOperator.mjs +67 -0
  388. package/_mjs/Push/Operator/SyncOperator.mjs.map +1 -0
  389. package/_mjs/Push/Operator.mjs +2 -0
  390. package/_mjs/Push/Operator.mjs.map +1 -0
  391. package/_mjs/Push/Producer/IOProducer.mjs +60 -0
  392. package/_mjs/Push/Producer/IOProducer.mjs.map +1 -0
  393. package/_mjs/Push/Producer/SyncProducer.mjs +94 -0
  394. package/_mjs/Push/Producer/SyncProducer.mjs.map +1 -0
  395. package/_mjs/Push/Producer.mjs +2 -0
  396. package/_mjs/Push/Producer.mjs.map +1 -0
  397. package/_mjs/Push/Sink.mjs +225 -0
  398. package/_mjs/Push/Sink.mjs.map +1 -0
  399. package/_mjs/Push/api.mjs +340 -348
  400. package/_mjs/Push/api.mjs.map +1 -1
  401. package/_mjs/Push/definition.mjs +75 -21
  402. package/_mjs/Push/definition.mjs.map +1 -1
  403. package/_mjs/Push/internal.mjs +30 -26
  404. package/_mjs/Push/internal.mjs.map +1 -1
  405. package/_mjs/Push.mjs +7 -1
  406. package/_mjs/Push.mjs.map +1 -1
  407. package/_mjs/Queue/api/dimapIO.mjs +74 -32
  408. package/_mjs/Queue/api/dimapIO.mjs.map +1 -1
  409. package/_mjs/Queue/api/filterInputIO.mjs +51 -25
  410. package/_mjs/Queue/api/filterInputIO.mjs.map +1 -1
  411. package/_mjs/Queue/api/filterOutputIO.mjs +60 -30
  412. package/_mjs/Queue/api/filterOutputIO.mjs.map +1 -1
  413. package/_mjs/Queue/api/zipWithIO.mjs +27 -10
  414. package/_mjs/Queue/api/zipWithIO.mjs.map +1 -1
  415. package/_mjs/Queue/definition.mjs +3 -7
  416. package/_mjs/Queue/definition.mjs.map +1 -1
  417. package/_mjs/Queue/internal.mjs +73 -62
  418. package/_mjs/Queue/internal.mjs.map +1 -1
  419. package/_mjs/Queue/strategy.mjs +1 -3
  420. package/_mjs/Queue/strategy.mjs.map +1 -1
  421. package/_mjs/Random/live.mjs +4 -3
  422. package/_mjs/Random/live.mjs.map +1 -1
  423. package/_mjs/Ref/Atomic.mjs +2 -3
  424. package/_mjs/Ref/Atomic.mjs.map +1 -1
  425. package/_mjs/Ref/Derived.mjs +2 -3
  426. package/_mjs/Ref/Derived.mjs.map +1 -1
  427. package/_mjs/Ref/DerivedAll.mjs +2 -3
  428. package/_mjs/Ref/DerivedAll.mjs.map +1 -1
  429. package/_mjs/Ref/Synchronized/definition.mjs +16 -15
  430. package/_mjs/Ref/Synchronized/definition.mjs.map +1 -1
  431. package/_mjs/Ref/definition.mjs +1 -5
  432. package/_mjs/Ref/definition.mjs.map +1 -1
  433. package/_mjs/Reloadable/definition.mjs +2 -0
  434. package/_mjs/Reloadable/definition.mjs.map +1 -1
  435. package/_mjs/STM/definition.mjs +29 -24
  436. package/_mjs/STM/definition.mjs.map +1 -1
  437. package/_mjs/STM/driver.mjs +5 -0
  438. package/_mjs/STM/driver.mjs.map +1 -1
  439. package/_mjs/STM/internal/Entry.mjs +8 -5
  440. package/_mjs/STM/internal/Entry.mjs.map +1 -1
  441. package/_mjs/STM/internal/TryCommit.mjs +6 -7
  442. package/_mjs/STM/internal/TryCommit.mjs.map +1 -1
  443. package/_mjs/STM/internal/Versioned.mjs +2 -3
  444. package/_mjs/STM/internal/Versioned.mjs.map +1 -1
  445. package/_mjs/Schedule/Decision.mjs +3 -4
  446. package/_mjs/Schedule/Decision.mjs.map +1 -1
  447. package/_mjs/Schedule/Driver.mjs +4 -0
  448. package/_mjs/Schedule/Driver.mjs.map +1 -1
  449. package/_mjs/Schedule/api.mjs +2 -5
  450. package/_mjs/Schedule/api.mjs.map +1 -1
  451. package/_mjs/Schedule/definition.mjs +3 -1
  452. package/_mjs/Schedule/definition.mjs.map +1 -1
  453. package/_mjs/Scope/ReleaseMap/definition.mjs +8 -2
  454. package/_mjs/Scope/ReleaseMap/definition.mjs.map +1 -1
  455. package/_mjs/Scope/api.mjs +23 -8
  456. package/_mjs/Scope/api.mjs.map +1 -1
  457. package/_mjs/Scope/definition.mjs +2 -6
  458. package/_mjs/Scope/definition.mjs.map +1 -1
  459. package/_mjs/ScopedRef/api.mjs +8 -3
  460. package/_mjs/ScopedRef/api.mjs.map +1 -1
  461. package/_mjs/ScopedRef/definition.mjs +1 -5
  462. package/_mjs/ScopedRef/definition.mjs.map +1 -1
  463. package/_mjs/Semaphore/Reservation.mjs +2 -0
  464. package/_mjs/Semaphore/Reservation.mjs.map +1 -1
  465. package/_mjs/Semaphore/definition.mjs +42 -38
  466. package/_mjs/Semaphore/definition.mjs.map +1 -1
  467. package/_mjs/Sink/definition.mjs +3 -3
  468. package/_mjs/Sink/definition.mjs.map +1 -1
  469. package/_mjs/State/api.mjs +1 -4
  470. package/_mjs/State/api.mjs.map +1 -1
  471. package/_mjs/State/definition.mjs +1 -5
  472. package/_mjs/State/definition.mjs.map +1 -1
  473. package/_mjs/State/internal.mjs +1 -5
  474. package/_mjs/State/internal.mjs.map +1 -1
  475. package/_mjs/Stream/api/zipAllWith.mjs +7 -11
  476. package/_mjs/Stream/api/zipAllWith.mjs.map +1 -1
  477. package/_mjs/Stream/api/zipWithChunks.mjs +5 -5
  478. package/_mjs/Stream/api/zipWithChunks.mjs.map +1 -1
  479. package/_mjs/Stream/api.mjs +8 -7
  480. package/_mjs/Stream/api.mjs.map +1 -1
  481. package/_mjs/Stream/definition.mjs +2 -3
  482. package/_mjs/Stream/definition.mjs.map +1 -1
  483. package/_mjs/Stream/internal/DebounceState.mjs +5 -5
  484. package/_mjs/Stream/internal/DebounceState.mjs.map +1 -1
  485. package/_mjs/Stream/internal/Handoff.mjs +17 -16
  486. package/_mjs/Stream/internal/Handoff.mjs.map +1 -1
  487. package/_mjs/Stream/internal/SinkEndReason.mjs +4 -11
  488. package/_mjs/Stream/internal/SinkEndReason.mjs.map +1 -1
  489. package/_mjs/Stream/internal/Take.mjs +3 -0
  490. package/_mjs/Stream/internal/Take.mjs.map +1 -1
  491. package/_mjs/Subject/Atomic.mjs +46 -15
  492. package/_mjs/Subject/Atomic.mjs.map +1 -1
  493. package/_mjs/Subject/DeferredRef.mjs +48 -0
  494. package/_mjs/Subject/DeferredRef.mjs.map +1 -0
  495. package/_mjs/Subject/Hold.mjs +30 -0
  496. package/_mjs/Subject/Hold.mjs.map +1 -0
  497. package/_mjs/Subject/RefSubject/Atomic.mjs +163 -0
  498. package/_mjs/Subject/RefSubject/Atomic.mjs.map +1 -0
  499. package/_mjs/Subject/RefSubject/Derived.mjs +95 -0
  500. package/_mjs/Subject/RefSubject/Derived.mjs.map +1 -0
  501. package/_mjs/Subject/RefSubject/RefSubject.mjs +11 -0
  502. package/_mjs/Subject/RefSubject/RefSubject.mjs.map +1 -0
  503. package/_mjs/Subject/RefSubject/constructors.mjs +23 -0
  504. package/_mjs/Subject/RefSubject/constructors.mjs.map +1 -0
  505. package/_mjs/Subject/RefSubject.mjs +2 -0
  506. package/_mjs/Subject/RefSubject.mjs.map +1 -0
  507. package/_mjs/Subject/definition.mjs +9 -0
  508. package/_mjs/Subject/definition.mjs.map +1 -1
  509. package/_mjs/Subject.mjs +3 -0
  510. package/_mjs/Subject.mjs.map +1 -1
  511. package/_mjs/SubscriptionRef.mjs +4 -5
  512. package/_mjs/SubscriptionRef.mjs.map +1 -1
  513. package/_mjs/Supervisor/constructors.mjs +3 -11
  514. package/_mjs/Supervisor/constructors.mjs.map +1 -1
  515. package/_mjs/Supervisor/definition.mjs +10 -4
  516. package/_mjs/Supervisor/definition.mjs.map +1 -1
  517. package/_mjs/SupervisorPatch.mjs +9 -12
  518. package/_mjs/SupervisorPatch.mjs.map +1 -1
  519. package/_mjs/TExit/definition.mjs +19 -18
  520. package/_mjs/TExit/definition.mjs.map +1 -1
  521. package/_mjs/TReentrantLock/definition.mjs +8 -3
  522. package/_mjs/TReentrantLock/definition.mjs.map +1 -1
  523. package/_mjs/TRef/definition.mjs +6 -6
  524. package/_mjs/TRef/definition.mjs.map +1 -1
  525. package/_mjs/internal/BackgroundScheduler.mjs +16 -16
  526. package/_mjs/internal/BackgroundScheduler.mjs.map +1 -1
  527. package/_mjs/internal/HashedPair.mjs +2 -0
  528. package/_mjs/internal/HashedPair.mjs.map +1 -1
  529. package/_mjs/internal/Hub.mjs +39 -15
  530. package/_mjs/internal/Hub.mjs.map +1 -1
  531. package/_mjs/internal/IsFatal.mjs +7 -11
  532. package/_mjs/internal/IsFatal.mjs.map +1 -1
  533. package/_mjs/internal/MutableQueue.mjs +14 -11
  534. package/_mjs/internal/MutableQueue.mjs.map +1 -1
  535. package/_mjs/internal/Scheduler.mjs +4 -8
  536. package/_mjs/internal/Scheduler.mjs.map +1 -1
  537. package/_mjs/internal/StackTraceBuilder.mjs +2 -4
  538. package/_mjs/internal/StackTraceBuilder.mjs.map +1 -1
  539. package/_src/Cached/api.ts +8 -2
  540. package/_src/Channel/internal/SingleProducerAsyncInput.ts +6 -4
  541. package/_src/CountdownLatch.ts +24 -13
  542. package/_src/Fiber/FiberRuntime.ts +4 -2
  543. package/_src/FiberRef/definition.ts +1 -1
  544. package/_src/Hub/api.ts +85 -54
  545. package/_src/Hub/internal.ts +36 -20
  546. package/_src/IO/api/foreachExec.ts +47 -0
  547. package/_src/IO/api.ts +0 -5
  548. package/_src/Push/Bounds.ts +4 -0
  549. package/_src/Push/FlattenStrategy.ts +137 -0
  550. package/_src/Push/IndexedBuffer.ts +79 -0
  551. package/_src/Push/MergeStrategy.ts +59 -0
  552. package/_src/Push/Operator/IOLoopOperator.ts +413 -0
  553. package/_src/Push/Operator/IOOperator.ts +173 -0
  554. package/_src/Push/Operator/LoopOperator.ts +242 -0
  555. package/_src/Push/Operator/SyncOperator.ts +107 -0
  556. package/_src/Push/Operator.ts +7 -0
  557. package/_src/Push/Producer/IOProducer.ts +83 -0
  558. package/_src/Push/Producer/SyncProducer.ts +105 -0
  559. package/_src/Push/Producer.ts +0 -0
  560. package/_src/Push/Sink.ts +302 -0
  561. package/_src/Push/api.ts +389 -515
  562. package/_src/Push/definition.ts +216 -23
  563. package/_src/Push/internal.ts +11 -0
  564. package/_src/Push.ts +7 -1
  565. package/_src/Queue/api/dimapIO.ts +57 -19
  566. package/_src/Queue/api/filterInputIO.ts +36 -12
  567. package/_src/Queue/api/filterOutputIO.ts +42 -18
  568. package/_src/Queue/api/zipWithIO.ts +23 -11
  569. package/_src/Queue/internal.ts +9 -3
  570. package/_src/Ref/Synchronized/definition.ts +81 -37
  571. package/_src/Ref/definition.ts +26 -0
  572. package/_src/Schedule/api.ts +1 -1
  573. package/_src/Scope/api.ts +22 -0
  574. package/_src/ScopedRef/api.ts +6 -2
  575. package/_src/Semaphore/definition.ts +4 -2
  576. package/_src/Sink/definition.ts +4 -5
  577. package/_src/Stream/api.ts +0 -2
  578. package/_src/Stream/definition.ts +0 -1
  579. package/_src/Subject/Atomic.ts +68 -11
  580. package/_src/Subject/DeferredRef.ts +44 -0
  581. package/_src/Subject/Hold.ts +48 -0
  582. package/_src/Subject/RefSubject/Atomic.ts +233 -0
  583. package/_src/Subject/RefSubject/Derived.ts +184 -0
  584. package/_src/Subject/RefSubject/RefSubject.ts +100 -0
  585. package/_src/Subject/RefSubject/constructors.ts +27 -0
  586. package/_src/Subject/RefSubject.ts +7 -0
  587. package/_src/Subject/definition.ts +21 -3
  588. package/_src/Subject.ts +6 -3
  589. package/_src/SubscriptionRef.ts +1 -1
  590. package/_src/Supervisor/constructors.ts +0 -2
  591. package/_src/Supervisor/definition.ts +2 -1
  592. package/_src/TReentrantLock/api.ts +1 -1
  593. package/_src/global.ts +8 -0
  594. package/_src/index.ts +49 -50
  595. package/_src/internal/MutableQueue.ts +5 -3
  596. package/global.d.ts +8 -0
  597. package/index.d.ts +0 -1
  598. package/internal/MutableQueue.d.ts +2 -2
  599. package/package.json +4 -4
  600. package/RefSubject/Atomic.d.ts +0 -34
  601. package/RefSubject/Synchronized/api.d.ts +0 -9
  602. package/RefSubject/Synchronized/definition.d.ts +0 -39
  603. package/RefSubject/api.d.ts +0 -120
  604. package/RefSubject/definition.d.ts +0 -52
  605. package/RefSubject.d.ts +0 -3
  606. package/_cjs/RefSubject/Atomic.cjs +0 -107
  607. package/_cjs/RefSubject/Atomic.cjs.map +0 -1
  608. package/_cjs/RefSubject/Synchronized/api.cjs +0 -22
  609. package/_cjs/RefSubject/Synchronized/api.cjs.map +0 -1
  610. package/_cjs/RefSubject/Synchronized/definition.cjs +0 -55
  611. package/_cjs/RefSubject/Synchronized/definition.cjs.map +0 -1
  612. package/_cjs/RefSubject/api.cjs +0 -251
  613. package/_cjs/RefSubject/api.cjs.map +0 -1
  614. package/_cjs/RefSubject/definition.cjs +0 -26
  615. package/_cjs/RefSubject/definition.cjs.map +0 -1
  616. package/_cjs/RefSubject.cjs +0 -39
  617. package/_cjs/RefSubject.cjs.map +0 -1
  618. package/_mjs/RefSubject/Atomic.mjs +0 -99
  619. package/_mjs/RefSubject/Atomic.mjs.map +0 -1
  620. package/_mjs/RefSubject/Synchronized/api.mjs +0 -15
  621. package/_mjs/RefSubject/Synchronized/api.mjs.map +0 -1
  622. package/_mjs/RefSubject/Synchronized/definition.mjs +0 -47
  623. package/_mjs/RefSubject/Synchronized/definition.mjs.map +0 -1
  624. package/_mjs/RefSubject/api.mjs +0 -229
  625. package/_mjs/RefSubject/api.mjs.map +0 -1
  626. package/_mjs/RefSubject/definition.mjs +0 -19
  627. package/_mjs/RefSubject/definition.mjs.map +0 -1
  628. package/_mjs/RefSubject.mjs +0 -5
  629. package/_mjs/RefSubject.mjs.map +0 -1
  630. package/_src/RefSubject/Atomic.ts +0 -129
  631. package/_src/RefSubject/Synchronized/api.ts +0 -14
  632. package/_src/RefSubject/Synchronized/definition.ts +0 -76
  633. package/_src/RefSubject/api.ts +0 -253
  634. package/_src/RefSubject/definition.ts +0 -70
  635. package/_src/RefSubject.ts +0 -5
package/_mjs/Push/api.mjs CHANGED
@@ -1,477 +1,469 @@
1
- var _a;
2
1
  const fileName_1 = "(@fncts/io) src/Push/api.ts";
3
- import * as tsplus_module_1 from "@fncts/io/Future/api";
4
- import * as tsplus_module_2 from "@fncts/io/IO/api/interrupt";
5
- import * as tsplus_module_3 from "@fncts/base/data/Either/destructors";
6
- import * as tsplus_module_4 from "@fncts/io/IO/api";
7
- import * as tsplus_module_5 from "@fncts/io/IO/api/forkIn";
8
- import * as tsplus_module_6 from "@fncts/io/IO/api/fulfill";
9
- import * as tsplus_module_7 from "@fncts/io/IO/runtime";
10
- import * as tsplus_module_8 from "@fncts/io/IO/api/scope";
11
- import * as tsplus_module_9 from "@fncts/io/Future/constructors";
12
- import * as tsplus_module_10 from "@fncts/io/IO/api/scoped";
13
- import * as tsplus_module_11 from "@fncts/io/Push/definition";
14
- import * as tsplus_module_12 from "@fncts/base/data/Either/constructors";
15
- import * as tsplus_module_13 from "@fncts/base/collection/Iterable/api";
16
- import * as tsplus_module_14 from "@fncts/io/IO/api/foreachConcurrent";
17
- import * as tsplus_module_15 from "@fncts/io/IO/api/delay";
18
- import * as tsplus_module_16 from "@fncts/base/data/Maybe/destructors";
19
- import * as tsplus_module_17 from "@fncts/io/Semaphore/constructors";
20
- import * as tsplus_module_18 from "@fncts/io/IO/api/concurrency";
21
- import * as tsplus_module_19 from "@fncts/base/data/function/api";
22
- import * as tsplus_module_20 from "@fncts/io/IO/api/asyncIO";
23
- import * as tsplus_module_21 from "@fncts/io/IO/api/forkDaemon";
24
- import * as tsplus_module_22 from "@fncts/io/Fiber/api/await";
25
- import * as tsplus_module_23 from "@fncts/io/IO/api/environment";
26
- import * as tsplus_module_24 from "@fncts/io/Fiber/api/interrupt";
27
- import * as tsplus_module_25 from "@fncts/base/data/Maybe/constructors";
28
- import * as tsplus_module_26 from "@fncts/base/data/Maybe/definition";
29
- import * as tsplus_module_27 from "@fncts/base/data/Cause/api";
30
- import * as tsplus_module_28 from "@fncts/io/Fiber/api/interruptFork";
31
- import * as tsplus_module_29 from "@fncts/io/IO/api/forkScoped";
32
- import * as tsplus_module_30 from "@fncts/base/collection/immutable/Conc/definition";
33
- import * as tsplus_module_31 from "@fncts/io/Fiber/api/joinAll";
34
- import * as tsplus_module_32 from "@fncts/io/IO/api/fork";
35
- import * as tsplus_module_33 from "@fncts/io/IO/api/asyncInterrupt";
36
- export const asyncInterrupt = asyncInterrupt_1;
37
- export const combineLatest = combineLatest_1;
38
- export const exhaustMap = exhaustMap_1;
39
- export const flatMapConcurrentBounded = flatMapConcurrentBounded_1;
40
- export const flatMapConcurrentUnbounded = flatMapConcurrentUnbounded_1;
41
- export const flatMap = flatMap_1;
42
- export const flatten = flatten_1;
2
+ import * as tsplus_module_1 from "@fncts/io/IO/api";
3
+ import * as tsplus_module_2 from "@fncts/io/IO/api/bracketExit";
4
+ import * as tsplus_module_3 from "@fncts/base/collection/Iterable/api";
5
+ import * as tsplus_module_4 from "@fncts/io/Push/Sink";
6
+ import * as tsplus_module_5 from "@fncts/io/CountdownLatch";
7
+ import * as tsplus_module_6 from "@fncts/io/IO/api/environment";
8
+ import * as tsplus_module_7 from "@fncts/base/data/Cause/api";
9
+ import * as tsplus_module_8 from "@fncts/base/data/Maybe/destructors";
10
+ import * as tsplus_module_9 from "@fncts/io/Push/FlattenStrategy";
11
+ import * as tsplus_module_10 from "@fncts/base/data/ExecutionStrategy";
12
+ import * as tsplus_module_11 from "@fncts/io/Push/Producer/SyncProducer";
13
+ import * as tsplus_module_12 from "@fncts/io/IO/definition";
14
+ import * as tsplus_module_13 from "@fncts/io/Scope/api";
15
+ import * as tsplus_module_14 from "@fncts/io/Layer/MemoMap";
16
+ import * as tsplus_module_15 from "@fncts/base/data/Environment/api";
17
+ export const contramapEnvironment = contramapEnvironment_1;
18
+ export const failCause = failCause_1;
19
+ export const failCauseNow = failCauseNow_1;
20
+ export const flatMapWithStrategy = flatMapWithStrategy_1;
43
21
  export const fromIO = fromIO_1;
44
- export const map = map_1;
45
- export const mapIO = mapIO_1;
46
- export const mergeAll = mergeAll_1;
47
- export const observe = observe_1;
48
- export const scoped = scoped_1;
49
- export const switchMap = switchMap_1;
50
- export const switchMapIO = switchMapIO_1;
51
- export const transform = transform_1;
52
- export const unfoldIO = unfoldIO_1;
53
- export const unwrap = unwrap_1;
54
- import { AtomicReference } from "@fncts/base/internal/AtomicReference";
55
- import { IO } from "@fncts/io/IO";
56
- import { withExhaust, withSwitch, withUnboundedConcurrency } from "@fncts/io/Push/internal";
57
- import { Push, PushTypeId, PushVariance, Sink } from "./definition.mjs";
58
- /**
59
- * @tsplus pipeable fncts.io.Push as
60
- */
61
- export function as(b) {
62
- return self => {
63
- return map_1(b)(self);
64
- };
22
+ export const fromIOProducer = fromIOProducer_1;
23
+ export const fromSyncProducer = fromSyncProducer_1;
24
+ export const provideSomeEnvironment = provideSomeEnvironment_1;
25
+ export const succeedNow = succeedNow_1;
26
+ import { Push, PushPrimitive } from "@fncts/io/Push/definition";
27
+ import { UnboundedStrategy } from "@fncts/io/Push/FlattenStrategy";
28
+ import { FromIO, FromScheduled, Scheduled } from "./Producer/IOProducer.mjs";
29
+ /**
30
+ * @tsplus static fncts.io.PushOps bracketExit
31
+ */
32
+ export function bracketExit(acquire, use, release) {
33
+ return new BracketExit(acquire, use, release);
34
+ }
35
+ class BracketExit extends Push {
36
+ acquire;
37
+ use;
38
+ release;
39
+ constructor(acquire, use, release) {
40
+ super();
41
+ this.acquire = acquire;
42
+ this.use = use;
43
+ this.release = release;
44
+ }
45
+ run(sink) {
46
+ return tsplus_module_1.catchAllCause(sink.onFailure, fileName_1 + ":38:20")(tsplus_module_2.bracketExit(() => this.acquire, a => this.use(a).run(sink), (a, exit) => tsplus_module_1.catchAllCause(sink.onFailure, fileName_1 + ":37:55")(this.release(a, exit)), fileName_1 + ":34:26"));
47
+ }
65
48
  }
66
49
  /**
67
- * @tsplus static fncts.io.PushOps asyncInterrupt
50
+ * @tsplus static fncts.io.PushOps defer
68
51
  */
69
- function asyncInterrupt_1(make) {
70
- return tsplus_module_11.makePush(sink => tsplus_module_10.scoped(tsplus_module_4.flatMap(future => tsplus_module_4.flatMap(scope => tsplus_module_4.flatMap(runtime => {
71
- const unsafeSink = {
72
- event: value => runtime.unsafeRunOrFork(tsplus_module_5.forkIn(scope, fileName_1 + ":34:77")(sink.event(value)), fileName_1 + ":34:52"),
73
- error: cause => runtime.unsafeRunOrFork(tsplus_module_5.forkIn(scope, fileName_1 + ":35:93")(tsplus_module_6.fulfill(future, fileName_1 + ":35:78")(sink.error(cause))), fileName_1 + ":35:52")
74
- };
75
- return tsplus_module_4.flatMap(eitherPush => tsplus_module_4.map(() => void 0, fileName_1 + ":38:10")(tsplus_module_3.match(canceller => tsplus_module_2.onInterrupt(() => canceller, fileName_1 + ":40:52")(tsplus_module_1.wait(future, fileName_1 + ":40:34")), push => push.run(sink))(eitherPush)), fileName_1 + ":37:29")(tsplus_module_4.succeed(() => make(unsafeSink), fileName_1 + ":37:32"));
76
- }, fileName_1 + ":32:26")(tsplus_module_7.runtime(fileName_1 + ":32:37")), fileName_1 + ":31:26")(tsplus_module_8.scope), fileName_1 + ":30:26")(tsplus_module_9.make(fileName_1 + ":30:38")), fileName_1 + ":44:9"));
52
+ export function defer(self) {
53
+ return new Defer(self);
54
+ }
55
+ class CombineLatest extends Push {
56
+ streams;
57
+ static UNSET = /*#__PURE__*/Symbol();
58
+ constructor(streams) {
59
+ super();
60
+ this.streams = streams;
61
+ }
62
+ run(sink) {
63
+ return UnboundedStrategy.withFork(fork => (() => {
64
+ const size = tsplus_module_3.size(this.streams);
65
+ return tsplus_module_1.flatMap(latch => {
66
+ const ref = Array(size).fill(CombineLatest.UNSET, 0, size);
67
+ const emitIfReady = tsplus_module_1.whenIO(latch.isOpen, fileName_1 + ":62:67")(tsplus_module_1.defer(() => sink.onSuccess(ref), fileName_1 + ":62:39"));
68
+ return tsplus_module_1.map(() => void 0, fileName_1 + ":64:10")(tsplus_module_1.foreach(tsplus_module_3.zipWithIndex(this.streams), ([i, stream]) => fork(stream.run(tsplus_module_4.unsafeMakeSink(value => tsplus_module_1.zipRight(emitIfReady, fileName_1 + ":80:25")(tsplus_module_1.defer(() => {
69
+ const indexEmpty = ref[i] === CombineLatest.UNSET;
70
+ ref[i] = value;
71
+ if (indexEmpty) {
72
+ return latch.countDown;
73
+ } else {
74
+ return tsplus_module_1.unit;
75
+ }
76
+ }, fileName_1 + ":70:29")), cause => sink.onFailure(cause)))), fileName_1 + ":65:21"));
77
+ }, fileName_1 + ":60:32")(tsplus_module_5.make(size));
78
+ })());
79
+ }
77
80
  }
78
- /**
79
- * @tsplus static fncts.io.PushOps async
80
- */
81
- export function async(make) {
82
- return asyncInterrupt_1(sink => {
83
- make(sink);
84
- return tsplus_module_12.left(tsplus_module_4.unit, fileName_1 + ":54:23");
85
- });
81
+ export function combineLatest(streams) {
82
+ return new CombineLatest(streams);
86
83
  }
87
- function combineLatest_1(streams) {
88
- return tsplus_module_11.makePush(emitter => (() => {
89
- const size = tsplus_module_13.size(streams);
90
- return tsplus_module_4.flatMap(ref => {
91
- const emitIfReady = tsplus_module_4.flatMap(as => as.length === size ? emitter.event(as) : tsplus_module_4.unit, fileName_1 + ":70:69")(tsplus_module_4.succeed(() => ref.filter(a => a != null), fileName_1 + ":70:31"));
92
- return tsplus_module_4.map(() => void 0, fileName_1 + ":73:8")(tsplus_module_14.foreachConcurrent(tsplus_module_13.zipWithIndex(streams), ([i, stream]) => stream.run(tsplus_module_11.makeSink(value => tsplus_module_4.zipRight(emitIfReady, fileName_1 + ":77:48")(tsplus_module_4.succeed(() => ref[i] = value, fileName_1 + ":77:28")), cause => emitter.error(cause))), fileName_1 + ":74:29"));
93
- }, fileName_1 + ":69:30")(tsplus_module_4.succeed(() => Array(size), fileName_1 + ":69:33"));
94
- })());
84
+ class ContramapEnvironment extends Push {
85
+ self;
86
+ f;
87
+ constructor(self, f) {
88
+ super();
89
+ this.self = self;
90
+ this.f = f;
91
+ }
92
+ run(sink) {
93
+ return tsplus_module_6.contramapEnvironment(this.f, fileName_1 + ":112:52")(this.self.run(sink));
94
+ }
95
95
  }
96
96
  /**
97
- * @tsplus pipeable fncts.io.PushOps combineLatestWith
97
+ * @tsplus pipeable fncts.io.Push contramapEnvironment
98
98
  */
99
- export function combineLatestWith(that, f) {
100
- return self => {
101
- return map_1(([a, b]) => f(a, b))(combineLatest_1([self, that]));
102
- };
99
+ function contramapEnvironment_1(f) {
100
+ return self => new ContramapEnvironment(self, f);
103
101
  }
104
- /**
105
- * @tsplus pipeable fncts.io.Push debounce
106
- */
107
- export function debounce(duration) {
108
- return self => {
109
- return switchMapIO_1(a => tsplus_module_15.delay(duration)(tsplus_module_4.succeedNow(a, fileName_1 + ":101:49")))(self);
110
- };
102
+ class Defer extends Push {
103
+ self;
104
+ constructor(self) {
105
+ super();
106
+ this.self = self;
107
+ }
108
+ run(sink) {
109
+ return tsplus_module_1.defer(() => this.self().run(sink), fileName_1 + ":128:20");
110
+ }
111
111
  }
112
112
  /**
113
- * @tsplus static fncts.io.PushOps defer
113
+ * @tsplus static fncts.io.PushOps failCause
114
114
  */
115
- export function defer(self) {
116
- return tsplus_module_11.makePush(emitter => tsplus_module_4.flatMap(push => push.run(emitter), fileName_1 + ":109:44")(tsplus_module_4.succeed(self, fileName_1 + ":109:30")));
115
+ function failCause_1(cause) {
116
+ const op = new PushPrimitive(3 /* PushTag.FailCause */);
117
+ op.i0 = cause;
118
+ return op;
117
119
  }
118
120
  /**
119
- * @tsplus pipeable fncts.io.Push exhaustMap
121
+ * @tsplus static fncts.io.PushOps failCauseNow
120
122
  */
121
- function exhaustMap_1(f) {
122
- return self => {
123
- return tsplus_module_11.makePush(sink => withExhaust(fork => self.run(tsplus_module_11.makeSink(a => fork(f(a).run(sink)), sink.error))));
124
- };
123
+ function failCauseNow_1(cause) {
124
+ const op = new PushPrimitive(3 /* PushTag.FailCause */);
125
+ op.i0 = () => cause;
126
+ return op;
125
127
  }
126
128
  /**
127
- * @tsplus pipeable fncts.io.Push exhaustMapIO
129
+ * @tsplus static fncts.io.PushOps failNow
128
130
  */
129
- export function exhaustMapIO(f) {
130
- return self => {
131
- return exhaustMap_1(a => fromIO_1(() => f(a)))(self);
132
- };
131
+ export function failNow(error) {
132
+ return failCauseNow_1(tsplus_module_7.fail(error));
133
133
  }
134
- /**
135
- * @tsplus pipeable fncts.io.Push filterIO
136
- */
137
- export function filterIO(predicate) {
138
- return self => {
139
- return tsplus_module_11.makePush(sink => self.run(tsplus_module_11.makeSink(a => tsplus_module_4.catchAllCause(sink.error, fileName_1 + ":141:29")(tsplus_module_4.flatMap(b => b ? sink.event(a) : tsplus_module_4.unit, fileName_1 + ":140:23")(predicate(a))), sink.error)));
140
- };
134
+ class Filter extends Push {
135
+ self;
136
+ p;
137
+ constructor(self, p) {
138
+ super();
139
+ this.self = self;
140
+ this.p = p;
141
+ }
142
+ run(sink) {
143
+ return this.self.run(tsplus_module_4.unsafeMakeSink(value => {
144
+ if (this.p(value)) {
145
+ return sink.onSuccess(value);
146
+ } else {
147
+ return tsplus_module_1.unit;
148
+ }
149
+ }, cause => sink.onFailure(cause)));
150
+ }
141
151
  }
142
- /**
143
- * @tsplus pipeable fncts.io.Push filterMapIO
144
- */
145
- export function filterMapIO(f) {
146
- return self => {
147
- return tsplus_module_11.makePush(sink => self.run(tsplus_module_11.makeSink(a => tsplus_module_4.catchAllCause(sink.error, fileName_1 + ":160:29")(tsplus_module_4.flatMap(mb => tsplus_module_16.match(() => tsplus_module_4.unit, sink.event)(mb), fileName_1 + ":159:23")(f(a))), sink.error)));
148
- };
152
+ export function filter(p) {
153
+ return self => new Filter(self, p);
149
154
  }
150
- export function filter(predicate) {
151
- return self => {
152
- return tsplus_module_11.makePush(sink => self.run(tsplus_module_11.makeSink(a => predicate(a) ? sink.event(a) : tsplus_module_4.unit, sink.error)));
153
- };
155
+ class FilterMap extends Push {
156
+ self;
157
+ f;
158
+ constructor(self, f) {
159
+ super();
160
+ this.self = self;
161
+ this.f = f;
162
+ }
163
+ run(sink) {
164
+ return this.self.run(tsplus_module_4.unsafeMakeSink(value => tsplus_module_8.match(() => tsplus_module_1.unit, b => sink.onSuccess(b))(this.f(value)), cause => sink.onFailure(cause)));
165
+ }
154
166
  }
155
167
  /**
156
168
  * @tsplus pipeable fncts.io.Push filterMap
157
169
  */
158
170
  export function filterMap(f) {
159
- return self => {
160
- return tsplus_module_11.makePush(sink => self.run(tsplus_module_11.makeSink(a => tsplus_module_16.match(() => tsplus_module_4.unit, sink.event)(f(a)), sink.error)));
161
- };
162
- }
163
- /**
164
- * @tsplus pipeable fncts.io.Push flatMapConcurrentBounded
165
- */
166
- function flatMapConcurrentBounded_1(f, concurrency) {
167
- return self => {
168
- return tsplus_module_11.makePush(emitter => tsplus_module_4.flatMap(semaphore => tsplus_module_4.map(() => void 0, fileName_1 + ":196:10")(flatMapConcurrentUnbounded_1(a => transform_1(io => semaphore.withPermit(io))(f(a)))(self).run(emitter)), fileName_1 + ":195:28")(tsplus_module_17.makeSemaphore(concurrency, fileName_1 + ":195:38")));
169
- };
171
+ return self => new FilterMap(self, f);
170
172
  }
171
173
  /**
172
- * @tsplus pipeable fncts.io.Push flatMapConcurrentUnbounded
174
+ * @tsplus pipeable fncts.io.Push flatMap
173
175
  */
174
- function flatMapConcurrentUnbounded_1(f) {
176
+ export function flatMap(f) {
175
177
  return self => {
176
- return tsplus_module_11.makePush(sink => withUnboundedConcurrency(fork => self.run(tsplus_module_11.makeSink(a => fork(f(a).run(sink)), sink.error))));
178
+ const op = new PushPrimitive(4 /* PushTag.OnSuccess */);
179
+ op.i0 = self;
180
+ op.i1 = f;
181
+ return op;
177
182
  };
178
183
  }
179
184
  /**
180
- * @tsplus pipeable fncts.io.Push flatMapConcurrent
185
+ * @tsplus pipeable fncts.io.Push flatMapUnbounded
181
186
  */
182
- export function flatMapConcurrent(f) {
183
- return self => {
184
- return unwrap_1(tsplus_module_4.map(concurrency => tsplus_module_16.match(() => flatMapConcurrentUnbounded_1(f)(self), n => flatMapConcurrentBounded_1(f, n)(self))(concurrency), fileName_1 + ":217:25")(tsplus_module_18.concurrency));
185
- };
187
+ export function flatMapUnbounded(f) {
188
+ return self => flatMapWithStrategy_1(f, tsplus_module_9.UnboundedStrategy, tsplus_module_10.concurrent)(self);
186
189
  }
187
190
  /**
188
- * @tsplus pipeable fncts.io.Push flatMap
191
+ * @tsplus pipeable fncts.io.Push flatMapWithStrategy
189
192
  */
190
- function flatMap_1(f) {
193
+ function flatMapWithStrategy_1(f, flattenStrategy, executionStrategy) {
191
194
  return self => {
192
- return flatMapConcurrentBounded_1(f, 1)(self);
195
+ const op = new PushPrimitive(5 /* PushTag.OnSuccessWithStrategy */);
196
+ op.i0 = self;
197
+ op.i1 = f;
198
+ op.i2 = flattenStrategy;
199
+ op.i3 = executionStrategy;
200
+ return op;
193
201
  };
194
202
  }
195
203
  /**
196
- * @tsplus getter fncts.io.Push flatten
204
+ * @tsplus static fncts.io.PushOps fromArray
197
205
  */
198
- function flatten_1(self) {
199
- return flatMap_1(tsplus_module_19.identity)(self);
206
+ export function fromArray(array) {
207
+ return fromSyncProducer_1(tsplus_module_11.fromArray(array));
200
208
  }
201
209
  /**
202
210
  * @tsplus static fncts.io.PushOps fromIO
203
211
  */
204
212
  function fromIO_1(io) {
205
- return tsplus_module_11.makePush(emitter => tsplus_module_4.matchCauseIO(cause => emitter.error(cause), value => emitter.event(value), fileName_1 + ":248:30")(tsplus_module_4.defer(io, fileName_1 + ":248:13")));
213
+ const concrete = io;
214
+ switch (concrete._ioOpCode) {
215
+ case 0 /* IOTag.SucceedNow */:
216
+ {
217
+ return succeedNow_1(concrete.i0);
218
+ }
219
+ case 1 /* IOTag.Fail */:
220
+ {
221
+ return failCause_1(concrete.i0);
222
+ }
223
+ case 2 /* IOTag.Sync */:
224
+ {
225
+ return fromSyncProducer_1(tsplus_module_11.fromSync(concrete.i0));
226
+ }
227
+ default:
228
+ {
229
+ return fromIOProducer_1(new FromIO(io));
230
+ }
231
+ }
206
232
  }
207
233
  /**
208
- * @tsplus static fncts.io.PushOps fromAsyncIterable
234
+ * @tsplus static fncts.io.PushOps fromIOProducer
209
235
  */
210
- export function fromAsyncIterable(iterable) {
211
- return tsplus_module_11.makePush(sink => tsplus_module_20.asyncIO(cb => tsplus_module_4.defer(() => fromAsyncIterableLoop(iterable[Symbol.asyncIterator](), sink, cb, fileName_1 + ":260:70"), fileName_1 + ":260:48"), fileName_1 + ":260:15"));
212
- }
213
- function fromAsyncIterableLoop(iterator, sink, cb, __tsplusTrace) {
214
- return tsplus_module_4.matchCauseIO(cause => sink.error(cause), result => result.done ? tsplus_module_4.succeed(() => cb(tsplus_module_4.unit), __tsplusTrace) : tsplus_module_4.zipRight(fromAsyncIterableLoop(iterator, sink, cb, __tsplusTrace), __tsplusTrace)(sink.event(result.value)), __tsplusTrace)(tsplus_module_4.fromPromiseHalt(iterator.next, __tsplusTrace));
236
+ function fromIOProducer_1(producer) {
237
+ const op = new PushPrimitive(2 /* PushTag.ProducerIO */);
238
+ op.i0 = producer;
239
+ return op;
215
240
  }
216
241
  /**
217
242
  * @tsplus static fncts.io.PushOps fromIterable
218
243
  */
219
244
  export function fromIterable(iterable) {
220
- return tsplus_module_11.makePush(sink => tsplus_module_20.asyncIO(cb => tsplus_module_4.defer(() => fromIterableLoop(iterable[Symbol.iterator](), sink, cb), fileName_1 + ":281:48"), fileName_1 + ":281:15"));
245
+ return fromSyncProducer_1(tsplus_module_11.fromIterable(iterable));
246
+ }
247
+ /**
248
+ * @tsplus static fncts.io.PushOps fromScheduled
249
+ */
250
+ export function fromScheduled(io, schedule) {
251
+ return fromIOProducer_1(new FromScheduled(io, schedule));
221
252
  }
222
- function fromIterableLoop(iterator, sink, cb) {
223
- return tsplus_module_4.defer(() => {
224
- const value = iterator.next();
225
- return value.done ? tsplus_module_4.succeed(() => cb(tsplus_module_4.unit), fileName_1 + ":292:27") : tsplus_module_4.zipRight(fromIterableLoop(iterator, sink, cb), fileName_1 + ":292:68")(sink.event(value.value));
226
- }, fileName_1 + ":290:18");
253
+ /**
254
+ * @tsplus static fncts.io.PushOps fromSyncProducer
255
+ */
256
+ function fromSyncProducer_1(producer) {
257
+ const op = new PushPrimitive(1 /* PushTag.ProducerSync */);
258
+ op.i0 = producer;
259
+ return op;
260
+ }
261
+ /**
262
+ * @tsplus static fncts.io.PushOps haltNow
263
+ */
264
+ export function haltNow(error) {
265
+ return failCauseNow_1(tsplus_module_7.halt(error));
227
266
  }
228
267
  /**
229
- * @tsplus getter fncts.io.Push multicast
268
+ * @tsplus static fncts.io.PushOps __call
230
269
  */
231
- export function multicast(self) {
232
- return new Multicast(self);
270
+ export function makePush(run) {
271
+ const op = new PushPrimitive(8 /* PushTag.FromPush */);
272
+ op.i0 = run;
273
+ return op;
233
274
  }
234
- export class Multicast {
235
- constructor(push) {
236
- this.push = push;
237
- this[_a] = PushTypeId;
238
- this.observers = [];
275
+ class Map extends Push {
276
+ self;
277
+ f;
278
+ constructor(self, f) {
279
+ super();
280
+ this.self = self;
281
+ this.f = f;
239
282
  }
240
283
  run(sink) {
241
- return tsplus_module_4.flatMap(environment => tsplus_module_4.map(() => void 0, fileName_1 + ":322:8")(tsplus_module_4.defer(() => {
242
- let io = tsplus_module_4.unit;
243
- if (this.observers.push({
244
- sink: sink,
245
- environment
246
- }) === 1) {
247
- io = tsplus_module_4.flatMap(fiber => tsplus_module_4.succeed(() => this.fiber = fiber, fileName_1 + ":326:70"), fileName_1 + ":326:56")(tsplus_module_21.forkDaemon(this.push.run(this), fileName_1 + ":326:37"));
248
- }
249
- return tsplus_module_4.zipRight(tsplus_module_2.ensuring(this.removeSink(sink), fileName_1 + ":328:49")(tsplus_module_22.wait(this.fiber, fileName_1 + ":328:34")), fileName_1 + ":328:22")(io);
250
- }, fileName_1 + ":323:17")), fileName_1 + ":321:28")(tsplus_module_23.environment(fileName_1 + ":321:43"));
251
- }
252
- event(value) {
253
- return tsplus_module_4.defer(() => tsplus_module_4.foreachDiscard(this.observers.slice(), observer => this.runValue(value, observer), fileName_1 + ":335:38"), fileName_1 + ":335:20");
254
- }
255
- error(cause) {
256
- return tsplus_module_4.defer(() => tsplus_module_4.foreachDiscard(this.observers.slice(), observer => this.runError(cause, observer), fileName_1 + ":339:38"), fileName_1 + ":339:20");
257
- }
258
- runValue(value, observer) {
259
- return tsplus_module_4.catchAllCause(() => this.removeSink(observer.sink), fileName_1 + ":346:21")(tsplus_module_23.provideEnvironment(observer.environment, fileName_1 + ":345:26")(observer.sink.event(value)));
260
- }
261
- runError(cause, observer) {
262
- return tsplus_module_4.catchAllCause(() => this.removeSink(observer.sink), fileName_1 + ":353:21")(tsplus_module_23.provideEnvironment(observer.environment, fileName_1 + ":352:26")(observer.sink.error(cause)));
263
- }
264
- removeSink(sink) {
265
- return tsplus_module_4.defer(() => {
266
- if (this.observers.length === 0) {
267
- return tsplus_module_4.unit;
268
- }
269
- const index = this.observers.findIndex(observer => observer.sink === sink);
270
- if (index > -1) {
271
- this.observers.splice(index, 1);
272
- if (this.observers.length === 0) {
273
- const interrupt = tsplus_module_24.interrupt(this.fiber);
274
- this.fiber = undefined;
275
- return interrupt;
276
- }
277
- }
278
- return tsplus_module_4.unit;
279
- }, fileName_1 + ":357:20");
284
+ return this.self.run(tsplus_module_4.unsafeMakeSink(value => sink.onSuccess(this.f(value)), cause => sink.onFailure(cause)));
280
285
  }
281
286
  }
282
- _a = PushTypeId;
283
287
  /**
284
- * @tsplus getter fncts.io.Push hold
288
+ * @tsplus pipeable fncts.io.Push map
285
289
  */
286
- export function hold(self) {
287
- return new Hold(self);
290
+ export function map(f) {
291
+ return self => new Map(self, f);
288
292
  }
289
- export class Hold extends Multicast {
290
- constructor(push) {
291
- super(push);
292
- this.push = push;
293
- this.current = new AtomicReference(tsplus_module_25.nothing(fileName_1 + ":383:49"));
293
+ class MapAccum extends Push {
294
+ self;
295
+ seed;
296
+ f;
297
+ constructor(self, seed, f) {
298
+ super();
299
+ this.self = self;
300
+ this.seed = seed;
301
+ this.f = f;
294
302
  }
295
303
  run(sink) {
296
- const current = this.current.get;
297
- if (tsplus_module_26.isJust(current)) {
298
- return tsplus_module_4.zipRight(super.run(sink), fileName_1 + ":393:41")(sink.event(current.value));
299
- }
300
- return super.run(sink);
301
- }
302
- event(value) {
303
- return tsplus_module_4.defer(() => {
304
- this.current.set(tsplus_module_25.just(value, fileName_1 + ":401:28"));
305
- return super.event(value);
306
- }, fileName_1 + ":400:20");
304
+ return tsplus_module_1.defer(() => {
305
+ let acc = this.seed;
306
+ return this.self.run(tsplus_module_4.unsafeMakeSink(value => {
307
+ const [s, b] = this.f(acc, value);
308
+ acc = s;
309
+ return sink.onSuccess(b);
310
+ }, cause => sink.onFailure(cause)));
311
+ }, fileName_1 + ":364:20");
307
312
  }
308
313
  }
309
314
  /**
310
- * @tsplus pipeable fncts.io.Push map 1
315
+ * @tsplus pipeable fncts.io.Push mapAccum
311
316
  */
312
- function map_1(f) {
313
- return self => {
314
- return mapIO_1(a => tsplus_module_4.succeedNow(f(a), fileName_1 + ":412:43"))(self);
315
- };
317
+ export function mapAccum(seed, f) {
318
+ return self => new MapAccum(self, seed, f);
316
319
  }
317
- /**
318
- * @tsplus pipeable fncts.io.Push mapError
319
- */
320
- export function mapError(f) {
321
- return self => {
322
- return tsplus_module_11.makePush(emitter => self.run(tsplus_module_11.makeSink(value => emitter.event(value), cause => emitter.error(tsplus_module_27.map(f)(cause)))));
323
- };
320
+ class MapIO extends Push {
321
+ self;
322
+ f;
323
+ constructor(self, f) {
324
+ super();
325
+ this.self = self;
326
+ this.f = f;
327
+ }
328
+ run(sink) {
329
+ return this.self.run(tsplus_module_4.unsafeMakeSink(value => tsplus_module_1.matchCauseIO(sink.onFailure, sink.onSuccess, fileName_1 + ":398:46")(this.f(value)), cause => sink.onFailure(cause)));
330
+ }
324
331
  }
325
332
  /**
326
- * @tsplus pipeable fncts.io.Push mapErrorCause
333
+ * @tsplus pipeable fncts.io.Push mapIO
327
334
  */
328
- export function mapErrorCause(f) {
329
- return self => {
330
- return tsplus_module_11.makePush(emitter => self.run(tsplus_module_11.makeSink(value => emitter.event(value), cause => emitter.error(f(cause)))));
331
- };
335
+ export function mapIO(f) {
336
+ return self => new MapIO(self, f);
332
337
  }
333
338
  /**
334
- * @tsplus pipeable fncts.io.Push mapIO
339
+ * @tsplus pipeable fncts.io.Push mapIOWithStrategy
335
340
  */
336
- function mapIO_1(f) {
337
- return self => tsplus_module_11.makePush(emitter => self.run(tsplus_module_11.makeSink(value => tsplus_module_4.matchCauseIO(cause => emitter.error(cause), b => emitter.event(b), fileName_1 + ":457:34")(f(value)), cause => emitter.error(cause))));
341
+ export function mapIOWithStrategy(f, flattenStrategy, executionStrategy) {
342
+ return self => flatMapWithStrategy_1(a => fromIO_1(f(a)), flattenStrategy, executionStrategy)(self);
343
+ }
344
+ class MergeWithStrategy extends Push {
345
+ ps;
346
+ mergeStrategy;
347
+ constructor(ps, mergeStrategy) {
348
+ super();
349
+ this.ps = ps;
350
+ this.mergeStrategy = mergeStrategy;
351
+ }
352
+ run(sink) {
353
+ return this.mergeStrategy.runMerge(this.ps, sink);
354
+ }
338
355
  }
339
356
  /**
340
- * @tsplus pipeable fncts.io.Push merge
357
+ * @tsplus static fncts.io.PushOps mergeWithStrategy
341
358
  */
342
- export function merge(that) {
343
- return self => {
344
- return mergeAll_1([self, that]);
345
- };
346
- }
347
- function mergeAll_1(streams) {
348
- return tsplus_module_11.makePush(sink => tsplus_module_14.foreachConcurrentDiscard(streams, stream => stream.run(tsplus_module_11.makeSink(sink.event, cause => tsplus_module_27.isInterruptedOnly(cause) ? tsplus_module_4.unit : sink.error(cause))), fileName_1 + ":485:32"));
359
+ export function mergeWithStrategy(streams, mergeStrategy) {
360
+ return new MergeWithStrategy(streams, mergeStrategy);
349
361
  }
350
362
  /**
351
363
  * @tsplus pipeable fncts.io.Push observe
352
364
  */
353
- function observe_1(f, __tsplusTrace) {
365
+ export function observe(f) {
354
366
  return self => {
355
- return tsplus_module_4.flatMap(future => tsplus_module_4.flatMap(fiber => tsplus_module_4.flatMap(() => tsplus_module_4.map(() => void 0, __tsplusTrace)(tsplus_module_28.interruptFork(fiber, __tsplusTrace)), __tsplusTrace)(tsplus_module_1.wait(future, __tsplusTrace)), __tsplusTrace)(tsplus_module_29.forkScoped(tsplus_module_4.flatMap(() => tsplus_module_1.succeed_(undefined, __tsplusTrace)(future), __tsplusTrace)(self.run(tsplus_module_11.makeSink(a => tsplus_module_4.catchAllCause(cause => tsplus_module_1.failCause(cause, __tsplusTrace)(future), __tsplusTrace)(f(a)), cause => tsplus_module_1.failCause(cause, __tsplusTrace)(future)))), __tsplusTrace)), __tsplusTrace)(tsplus_module_9.make(__tsplusTrace));
367
+ return self.run(tsplus_module_4.unsafeMakeSink(f, cause => tsplus_module_1.orHalt(tsplus_module_1.failCause(() => cause, fileName_1 + ":458:63"), fileName_1 + ":458:70")));
356
368
  };
357
369
  }
358
- /**
359
- * @tsplus static fncts.io.PushOps repeatIOMaybe
360
- */
361
- export function repeatIOMaybe(io, __tsplusTrace) {
362
- return unfoldIO_1(undefined, () => tsplus_module_4.catchAll(maybeError => tsplus_module_16.match(() => tsplus_module_4.succeedNow(tsplus_module_25.nothing(__tsplusTrace), __tsplusTrace), tsplus_module_4.failNow)(maybeError), __tsplusTrace)(tsplus_module_4.map(a => tsplus_module_25.just([a, undefined], __tsplusTrace), __tsplusTrace)(io)));
363
- }
364
- /**
365
- * @tsplus getter fncts.io.Push runCollect
366
- */
367
- export function runCollect(self) {
368
- return tsplus_module_4.defer(() => {
369
- const out = [];
370
- return tsplus_module_4.as(() => tsplus_module_30.fromArray(out), fileName_1 + ":532:51")(observe_1(a => tsplus_module_4.succeed(() => out.push(a), fileName_1 + ":532:34"), fileName_1 + ":532:24")(self));
371
- }, fileName_1 + ":530:18");
370
+ class OrElseCause extends Push {
371
+ self;
372
+ that;
373
+ constructor(self, that) {
374
+ super();
375
+ this.self = self;
376
+ this.that = that;
377
+ }
378
+ run(sink) {
379
+ return this.self.run(tsplus_module_4.unsafeMakeSink(sink.onSuccess, cause => this.that(cause).run(sink)));
380
+ }
372
381
  }
373
382
  /**
374
- * @tsplus getter fncts.io.Push runDrain
383
+ * @tsplus pipeable fncts.io.Push orElseCause
375
384
  */
376
- export function runDrain(self) {
377
- return observe_1(() => tsplus_module_4.unit, fileName_1 + ":540:22")(self);
385
+ export function orElseCause(that) {
386
+ return self => new OrElseCause(self, that);
378
387
  }
379
388
  /**
380
- * @tsplus static fncts.io.PushOps scoped
389
+ * @tsplus pipeable fncts.io.Push provideEnvironment
381
390
  */
382
- function scoped_1(io, __tsplusTrace) {
383
- return tsplus_module_11.makePush(emitter => tsplus_module_4.matchCauseIO(cause => emitter.error(cause), value => emitter.event(value), __tsplusTrace)(tsplus_module_10.scoped(tsplus_module_4.defer(io, __tsplusTrace), __tsplusTrace)));
391
+ export function provideEnvironment(environment) {
392
+ return self => provideSomeEnvironment_1(environment)(self);
384
393
  }
385
- /**
386
- * @tsplus static fncts.io.PushOps succeed
387
- */
388
- export function succeed(value) {
389
- return fromIO_1(() => tsplus_module_4.succeed(value, fileName_1 + ":559:32"));
394
+ class ProvideLayer extends Push {
395
+ self;
396
+ layer;
397
+ constructor(self, layer) {
398
+ super();
399
+ this.self = self;
400
+ this.layer = layer;
401
+ }
402
+ run(sink) {
403
+ return tsplus_module_2.bracketExit(() => tsplus_module_13.make, scope => tsplus_module_1.matchCauseIO(sink.onFailure, environment => tsplus_module_6.provideSomeEnvironment(environment, fileName_1 + ":501:100")(this.self.run(sink)), fileName_1 + ":501:24")(tsplus_module_14.build_(scope, fileName_1 + ":500:17")(this.layer)), (scope, exit) => scope.close(() => exit), fileName_1 + ":496:26");
404
+ }
390
405
  }
391
406
  /**
392
- * @tsplus pipeable fncts.io.Push switchMap
407
+ * @tsplus pipeable fncts.io.Push provideLayer
393
408
  */
394
- function switchMap_1(f) {
395
- return self => {
396
- return tsplus_module_11.makePush(sink => withSwitch(fork => self.run(tsplus_module_11.makeSink(a => fork(f(a).run(sink)), sink.error))));
397
- };
409
+ export function provideLayer(layer) {
410
+ return self => new ProvideLayer(self, layer);
398
411
  }
399
412
  /**
400
- * @tsplus pipeable fncts.io.Push switchMapIO
413
+ * @tsplus pipeable fncts.io.Push provideSomeEnvironment
401
414
  */
402
- function switchMapIO_1(f) {
403
- return self => {
404
- return switchMap_1(a => fromIO_1(() => f(a)))(self);
405
- };
415
+ function provideSomeEnvironment_1(environment) {
416
+ return self => contramapEnvironment_1(r => tsplus_module_15.union(environment)(r))(self);
406
417
  }
407
418
  /**
408
- * @tsplus pipeable fncts.io.Push tap
419
+ * @tsplus static fncts.io.PushOps schedule
409
420
  */
410
- export function tap(f) {
411
- return self => {
412
- return tsplus_module_11.makePush(sink => self.run(tsplus_module_11.makeSink(a => tsplus_module_4.matchCauseIO(sink.error, () => sink.event(a), fileName_1 + ":585:65")(f(a)), sink.error)));
413
- };
421
+ export function schedule(io, schedule) {
422
+ return fromIOProducer_1(new Scheduled(io, schedule));
414
423
  }
415
424
  /**
416
- * @tsplus pipeable fncts.io.Push transform
425
+ * @tsplus static fncts.io.PushOps succeed
417
426
  */
418
- function transform_1(f) {
419
- return self => tsplus_module_11.makePush(emitter => f(self.run(emitter)));
420
- }
421
- function unfoldLoop(s, f, emitter) {
422
- return tsplus_module_16.match(() => tsplus_module_4.unit, ([a, s]) => tsplus_module_4.zipRight(unfoldLoop(s, f, emitter), fileName_1 + ":603:35")(emitter.event(a)))(f(s));
427
+ export function succeed(value) {
428
+ return fromSyncProducer_1(tsplus_module_11.fromSync(value));
423
429
  }
424
430
  /**
425
- * @tsplus static fncts.io.PushOps unfold
431
+ * @tsplus static fncts.io.PushOps succeedNow
426
432
  */
427
- export function unfold(s, f) {
428
- return tsplus_module_11.makePush(emitter => unfoldLoop(s, f, emitter));
429
- }
430
- function unfoldIOLoop(s, f, emitter) {
431
- return tsplus_module_4.catchAllCause(cause => emitter.error(cause), fileName_1 + ":626:19")(tsplus_module_4.flatMap(result => tsplus_module_16.match(() => tsplus_module_4.unit, ([a, s]) => tsplus_module_4.zipRight(unfoldIOLoop(s, f, emitter), fileName_1 + ":623:39")(emitter.event(a)))(result), fileName_1 + ":620:13")(f(s)));
433
+ function succeedNow_1(value) {
434
+ return fromSyncProducer_1(tsplus_module_11.success(value));
432
435
  }
433
436
  /**
434
- * @tsplus static fncts.io.PushOps unfoldIO
437
+ * @tsplus pipeable fncts.io.Push switchMap
435
438
  */
436
- function unfoldIO_1(s, f) {
437
- return tsplus_module_11.makePush(emitter => unfoldIOLoop(s, f, emitter));
439
+ export function switchMap(f, executionStrategy) {
440
+ return self => flatMapWithStrategy_1(f, tsplus_module_9.SwitchStrategy, executionStrategy ?? tsplus_module_10.sequential)(self);
438
441
  }
439
442
  /**
440
- * @tsplus pipeable fncts.io.Push untilFuture
443
+ * @tsplus pipeable fncts.io.Push transform
441
444
  */
442
- export function untilFuture(future) {
445
+ export function transform(f) {
443
446
  return self => {
444
- return tsplus_module_11.makePush(sink => tsplus_module_20.asyncIO(cb => {
445
- const exit = tsplus_module_4.succeed(() => cb(tsplus_module_4.unit), fileName_1 + ":643:24");
446
- return tsplus_module_4.flatMap(streamFiber => tsplus_module_4.flatMap(futureFiber => tsplus_module_4.map(() => void 0, fileName_1 + ":654:12")(tsplus_module_31.joinAll([streamFiber, futureFiber], fileName_1 + ":654:26")), fileName_1 + ":646:32")(tsplus_module_32.fork(tsplus_module_4.zipRight(exit, fileName_1 + ":652:24")(tsplus_module_4.matchCauseIO(cause => sink.error(cause), () => tsplus_module_4.unit, fileName_1 + ":648:28")(tsplus_module_1.wait(future, fileName_1 + ":647:19"))), fileName_1 + ":652:30")), fileName_1 + ":645:32")(tsplus_module_32.fork(self.run(sink), fileName_1 + ":645:47"));
447
- }, fileName_1 + ":642:17"));
447
+ const op = new PushPrimitive(9 /* PushTag.Transform */);
448
+ op.i0 = self;
449
+ op.i1 = f;
450
+ return op;
448
451
  };
449
452
  }
450
- /**
451
- * @tsplus pipeable fncts.io.Push untilPush
452
- */
453
- export function untilPush(signal) {
454
- return self => {
455
- return tsplus_module_11.makePush(sink => tsplus_module_20.asyncIO(cb => {
456
- const exit = tsplus_module_4.succeed(() => cb(tsplus_module_4.unit), fileName_1 + ":668:24");
457
- return tsplus_module_4.flatMap(signalFiber => tsplus_module_4.flatMap(streamFiber => tsplus_module_4.map(() => void 0, fileName_1 + ":679:12")(tsplus_module_31.joinAll([signalFiber, streamFiber], fileName_1 + ":679:26")), fileName_1 + ":678:32")(tsplus_module_32.fork(self.run(sink), fileName_1 + ":678:47")), fileName_1 + ":670:32")(tsplus_module_32.fork(signal.run(tsplus_module_11.makeSink(() => exit, cause => sink.error(cause))), fileName_1 + ":676:14"));
458
- }, fileName_1 + ":667:17"));
459
- };
453
+ class Unwrap extends Push {
454
+ io;
455
+ constructor(io) {
456
+ super();
457
+ this.io = io;
458
+ }
459
+ run(sink) {
460
+ return tsplus_module_1.matchCauseIO(cause => sink.onFailure(cause), stream => stream.run(sink), fileName_1 + ":568:32")(this.io);
461
+ }
460
462
  }
461
463
  /**
462
464
  * @tsplus static fncts.io.PushOps unwrap
463
465
  */
464
- function unwrap_1(io) {
465
- return flatten_1(fromIO_1(() => io));
466
- }
467
- /**
468
- * @tsplus static fncts.io.PushOps unwrapScoped
469
- */
470
- export function unwrapScoped(self, __tsplusTrace) {
471
- return flatten_1(scoped_1(() => self, __tsplusTrace));
466
+ export function unwrap(io) {
467
+ return new Unwrap(io);
472
468
  }
473
- /**
474
- * @tsplus static fncts.io.PushOps never
475
- */
476
- export const never = /*#__PURE__*/fromIO_1(() => tsplus_module_33.never);
477
469
  //# sourceMappingURL=api.mjs.map