@fncts/io 0.0.48 → 0.0.50

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 (873) hide show
  1. package/Cached/api.d.ts +1 -1
  2. package/Channel/api.d.ts +80 -80
  3. package/Channel/core-api.d.ts +26 -26
  4. package/Console/definition.d.ts +1 -0
  5. package/CountdownLatch.d.ts +1 -0
  6. package/Fiber/FiberMessage.d.ts +6 -28
  7. package/Fiber/FiberRuntime.d.ts +108 -77
  8. package/Fiber/api/interruptAs.d.ts +2 -2
  9. package/Fiber/definition.d.ts +2 -0
  10. package/FiberScope/definition.d.ts +3 -0
  11. package/FiberSet.d.ts +2 -1
  12. package/Future/State.d.ts +59 -0
  13. package/Future/api.d.ts +8 -3
  14. package/Future/constructors.d.ts +1 -1
  15. package/Future/definition.d.ts +1 -17
  16. package/Future.d.ts +1 -0
  17. package/Hub/api.d.ts +15 -15
  18. package/IO/api/array.d.ts +22 -0
  19. package/IO/api/awaitAllChildren.d.ts +6 -0
  20. package/IO/api/cachedInvalidate.d.ts +15 -0
  21. package/IO/api/foreachExec.d.ts +18 -0
  22. package/IO/api/forkDaemon.d.ts +1 -1
  23. package/IO/api/onTermination.d.ts +1 -2
  24. package/IO/api/transplant.d.ts +11 -1
  25. package/IO/api.d.ts +247 -225
  26. package/IO/definition.d.ts +12 -25
  27. package/IO.d.ts +3 -1
  28. package/Push/Bounds.d.ts +4 -0
  29. package/Push/FlattenStrategy.d.ts +47 -0
  30. package/Push/IndexedBuffer.d.ts +19 -0
  31. package/Push/MergeStrategy.d.ts +19 -0
  32. package/Push/Operator/IOLoopOperator.d.ts +61 -0
  33. package/Push/Operator/IOOperator.d.ts +63 -0
  34. package/Push/Operator/LoopOperator.d.ts +50 -0
  35. package/Push/Operator/SyncOperator.d.ts +41 -0
  36. package/Push/Operator.d.ts +4 -0
  37. package/Push/Producer/IOProducer.d.ts +41 -0
  38. package/Push/Producer/SyncProducer.d.ts +61 -0
  39. package/Push/Producer.d.ts +1 -0
  40. package/Push/Sink.d.ts +65 -0
  41. package/Push/api.d.ts +78 -161
  42. package/Push/definition.d.ts +92 -19
  43. package/Push/internal.d.ts +3 -0
  44. package/Push.d.ts +6 -0
  45. package/Random/definition.d.ts +1 -0
  46. package/Ref/Synchronized/api.d.ts +1 -1
  47. package/Ref/Synchronized/definition.d.ts +32 -9
  48. package/Ref/definition.d.ts +12 -0
  49. package/Scope/api.d.ts +16 -1
  50. package/Semaphore/Reservation.d.ts +15 -0
  51. package/Semaphore/constructors.d.ts +13 -0
  52. package/Semaphore/definition.d.ts +29 -0
  53. package/Semaphore.d.ts +3 -40
  54. package/Sink/definition.d.ts +5 -6
  55. package/Stream/api.d.ts +164 -164
  56. package/Subject/Atomic.d.ts +19 -9
  57. package/Subject/DeferredRef.d.ts +17 -0
  58. package/Subject/Hold.d.ts +19 -0
  59. package/Subject/RefSubject/Atomic.d.ts +41 -0
  60. package/Subject/RefSubject/Derived.d.ts +43 -0
  61. package/Subject/RefSubject/RefSubject.d.ts +27 -0
  62. package/Subject/definition.d.ts +14 -2
  63. package/Subject.d.ts +2 -0
  64. package/SubscriptionRef.d.ts +0 -1
  65. package/_cjs/Cached/api.cjs +1 -2
  66. package/_cjs/Cached/api.cjs.map +1 -1
  67. package/_cjs/Cached/internal.cjs +1 -2
  68. package/_cjs/Cached/internal.cjs.map +1 -1
  69. package/_cjs/Channel/api/interruptWhen.cjs +1 -2
  70. package/_cjs/Channel/api/interruptWhen.cjs.map +1 -1
  71. package/_cjs/Channel/api/mapOutConcurrentIO.cjs +2 -3
  72. package/_cjs/Channel/api/mapOutConcurrentIO.cjs.map +1 -1
  73. package/_cjs/Channel/api/mergeAll.cjs +1 -2
  74. package/_cjs/Channel/api/mergeAll.cjs.map +1 -1
  75. package/_cjs/Channel/api/mergeAllUnboundedWith.cjs +1 -2
  76. package/_cjs/Channel/api/mergeAllUnboundedWith.cjs.map +1 -1
  77. package/_cjs/Channel/api/mergeAllWith.cjs +2 -3
  78. package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
  79. package/_cjs/Channel/api/mergeMap.cjs +1 -2
  80. package/_cjs/Channel/api/mergeMap.cjs.map +1 -1
  81. package/_cjs/Channel/api/mergeWith.cjs +1 -2
  82. package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
  83. package/_cjs/Channel/api/run.cjs +1 -2
  84. package/_cjs/Channel/api/run.cjs.map +1 -1
  85. package/_cjs/Channel/api/runCollect.cjs +1 -2
  86. package/_cjs/Channel/api/runCollect.cjs.map +1 -1
  87. package/_cjs/Channel/api/runDrain.cjs +1 -2
  88. package/_cjs/Channel/api/runDrain.cjs.map +1 -1
  89. package/_cjs/Channel/api/runScoped.cjs +3 -4
  90. package/_cjs/Channel/api/runScoped.cjs.map +1 -1
  91. package/_cjs/Channel/api/toPull.cjs +2 -3
  92. package/_cjs/Channel/api/toPull.cjs.map +1 -1
  93. package/_cjs/Channel/api/zipConcurrent.cjs +1 -2
  94. package/_cjs/Channel/api/zipConcurrent.cjs.map +1 -1
  95. package/_cjs/Channel/api.cjs +206 -207
  96. package/_cjs/Channel/api.cjs.map +1 -1
  97. package/_cjs/Channel/core-api.cjs +43 -42
  98. package/_cjs/Channel/core-api.cjs.map +1 -1
  99. package/_cjs/Channel/internal/ChannelExecutor.cjs +4 -5
  100. package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
  101. package/_cjs/Channel/internal/ChannelState.cjs +1 -2
  102. package/_cjs/Channel/internal/ChannelState.cjs.map +1 -1
  103. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +1 -2
  104. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
  105. package/_cjs/Clock/api.cjs +1 -2
  106. package/_cjs/Clock/api.cjs.map +1 -1
  107. package/_cjs/Clock/definition.cjs +1 -2
  108. package/_cjs/Clock/definition.cjs.map +1 -1
  109. package/_cjs/Clock/live.cjs +1 -2
  110. package/_cjs/Clock/live.cjs.map +1 -1
  111. package/_cjs/Console/api.cjs +1 -2
  112. package/_cjs/Console/api.cjs.map +1 -1
  113. package/_cjs/Console/definition.cjs +2 -2
  114. package/_cjs/Console/definition.cjs.map +1 -1
  115. package/_cjs/Console/live.cjs +1 -2
  116. package/_cjs/Console/live.cjs.map +1 -1
  117. package/_cjs/CountdownLatch.cjs +3 -3
  118. package/_cjs/CountdownLatch.cjs.map +1 -1
  119. package/_cjs/Differ/api.cjs +1 -2
  120. package/_cjs/Differ/api.cjs.map +1 -1
  121. package/_cjs/Fiber/FiberMessage.cjs +3 -24
  122. package/_cjs/Fiber/FiberMessage.cjs.map +1 -1
  123. package/_cjs/Fiber/FiberRuntime.cjs +879 -636
  124. package/_cjs/Fiber/FiberRuntime.cjs.map +1 -1
  125. package/_cjs/Fiber/api/awaitAll.cjs +1 -2
  126. package/_cjs/Fiber/api/awaitAll.cjs.map +1 -1
  127. package/_cjs/Fiber/api/collectAll.cjs +2 -3
  128. package/_cjs/Fiber/api/collectAll.cjs.map +1 -1
  129. package/_cjs/Fiber/api/fromIO.cjs +1 -2
  130. package/_cjs/Fiber/api/fromIO.cjs.map +1 -1
  131. package/_cjs/Fiber/api/interrupt.cjs +2 -3
  132. package/_cjs/Fiber/api/interrupt.cjs.map +1 -1
  133. package/_cjs/Fiber/api/interruptAll.cjs +2 -3
  134. package/_cjs/Fiber/api/interruptAll.cjs.map +1 -1
  135. package/_cjs/Fiber/api/interruptAs.cjs +5 -10
  136. package/_cjs/Fiber/api/interruptAs.cjs.map +1 -1
  137. package/_cjs/Fiber/api/interruptFork.cjs +2 -3
  138. package/_cjs/Fiber/api/interruptFork.cjs.map +1 -1
  139. package/_cjs/Fiber/api/join.cjs +1 -2
  140. package/_cjs/Fiber/api/join.cjs.map +1 -1
  141. package/_cjs/Fiber/api/joinAll.cjs +1 -2
  142. package/_cjs/Fiber/api/joinAll.cjs.map +1 -1
  143. package/_cjs/Fiber/api/mapFiber.cjs +1 -2
  144. package/_cjs/Fiber/api/mapFiber.cjs.map +1 -1
  145. package/_cjs/Fiber/api/mapIO.cjs +2 -3
  146. package/_cjs/Fiber/api/mapIO.cjs.map +1 -1
  147. package/_cjs/Fiber/api/zipWith.cjs +2 -3
  148. package/_cjs/Fiber/api/zipWith.cjs.map +1 -1
  149. package/_cjs/Fiber/constructors.cjs +2 -3
  150. package/_cjs/Fiber/constructors.cjs.map +1 -1
  151. package/_cjs/Fiber/definition.cjs +6 -4
  152. package/_cjs/Fiber/definition.cjs.map +1 -1
  153. package/_cjs/FiberRef/api/locallyScoped.cjs +1 -2
  154. package/_cjs/FiberRef/api/locallyScoped.cjs.map +1 -1
  155. package/_cjs/FiberRef/api/locallyScopedWith.cjs +1 -2
  156. package/_cjs/FiberRef/api/locallyScopedWith.cjs.map +1 -1
  157. package/_cjs/FiberRef/constructors.cjs +1 -2
  158. package/_cjs/FiberRef/constructors.cjs.map +1 -1
  159. package/_cjs/FiberRef/definition.cjs +1 -2
  160. package/_cjs/FiberRef/definition.cjs.map +1 -1
  161. package/_cjs/FiberRef/operations.cjs +1 -2
  162. package/_cjs/FiberRef/operations.cjs.map +1 -1
  163. package/_cjs/FiberRef/unsafe.cjs +1 -2
  164. package/_cjs/FiberRef/unsafe.cjs.map +1 -1
  165. package/_cjs/FiberRefs/Patch.cjs +1 -2
  166. package/_cjs/FiberRefs/Patch.cjs.map +1 -1
  167. package/_cjs/FiberRefs/api.cjs +1 -2
  168. package/_cjs/FiberRefs/api.cjs.map +1 -1
  169. package/_cjs/FiberRefs/definition.cjs +1 -2
  170. package/_cjs/FiberRefs/definition.cjs.map +1 -1
  171. package/_cjs/FiberScope/definition.cjs +29 -6
  172. package/_cjs/FiberScope/definition.cjs.map +1 -1
  173. package/_cjs/FiberSet.cjs +16 -15
  174. package/_cjs/FiberSet.cjs.map +1 -1
  175. package/_cjs/FiberStatus/definition.cjs +1 -2
  176. package/_cjs/FiberStatus/definition.cjs.map +1 -1
  177. package/_cjs/Future/State.cjs +108 -0
  178. package/_cjs/Future/State.cjs.map +1 -0
  179. package/_cjs/Future/api.cjs +71 -64
  180. package/_cjs/Future/api.cjs.map +1 -1
  181. package/_cjs/Future/constructors.cjs +3 -4
  182. package/_cjs/Future/constructors.cjs.map +1 -1
  183. package/_cjs/Future/definition.cjs +1 -15
  184. package/_cjs/Future/definition.cjs.map +1 -1
  185. package/_cjs/Future.cjs +11 -0
  186. package/_cjs/Future.cjs.map +1 -1
  187. package/_cjs/Hub/api.cjs +56 -57
  188. package/_cjs/Hub/api.cjs.map +1 -1
  189. package/_cjs/Hub/internal.cjs +1 -2
  190. package/_cjs/Hub/internal.cjs.map +1 -1
  191. package/_cjs/IO/api/acquireRelease.cjs +1 -2
  192. package/_cjs/IO/api/acquireRelease.cjs.map +1 -1
  193. package/_cjs/IO/api/acquireReleaseExit.cjs +1 -2
  194. package/_cjs/IO/api/acquireReleaseExit.cjs.map +1 -1
  195. package/_cjs/IO/api/acquireReleaseInterruptible.cjs +1 -2
  196. package/_cjs/IO/api/acquireReleaseInterruptible.cjs.map +1 -1
  197. package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs +1 -2
  198. package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs.map +1 -1
  199. package/_cjs/IO/api/addFinalizer.cjs +1 -2
  200. package/_cjs/IO/api/addFinalizer.cjs.map +1 -1
  201. package/_cjs/IO/api/addFinalizerExit.cjs +1 -2
  202. package/_cjs/IO/api/addFinalizerExit.cjs.map +1 -1
  203. package/_cjs/IO/api/all.cjs +1 -2
  204. package/_cjs/IO/api/all.cjs.map +1 -1
  205. package/_cjs/IO/api/array.cjs +51 -0
  206. package/_cjs/IO/api/array.cjs.map +1 -0
  207. package/_cjs/IO/api/asyncIO.cjs +1 -2
  208. package/_cjs/IO/api/asyncIO.cjs.map +1 -1
  209. package/_cjs/IO/api/asyncInterrupt.cjs +1 -2
  210. package/_cjs/IO/api/asyncInterrupt.cjs.map +1 -1
  211. package/_cjs/IO/api/awaitAllChildren.cjs +17 -0
  212. package/_cjs/IO/api/awaitAllChildren.cjs.map +1 -0
  213. package/_cjs/IO/api/blocking.cjs +1 -2
  214. package/_cjs/IO/api/blocking.cjs.map +1 -1
  215. package/_cjs/IO/api/bracket.cjs +1 -2
  216. package/_cjs/IO/api/bracket.cjs.map +1 -1
  217. package/_cjs/IO/api/bracketExit.cjs +1 -2
  218. package/_cjs/IO/api/bracketExit.cjs.map +1 -1
  219. package/_cjs/IO/api/cachedInvalidate.cjs +47 -0
  220. package/_cjs/IO/api/cachedInvalidate.cjs.map +1 -0
  221. package/_cjs/IO/api/clockWith.cjs +1 -2
  222. package/_cjs/IO/api/clockWith.cjs.map +1 -1
  223. package/_cjs/IO/api/concurrency.cjs +1 -2
  224. package/_cjs/IO/api/concurrency.cjs.map +1 -1
  225. package/_cjs/IO/api/concurrentFinalizers.cjs +1 -2
  226. package/_cjs/IO/api/concurrentFinalizers.cjs.map +1 -1
  227. package/_cjs/IO/api/consoleWith.cjs +1 -2
  228. package/_cjs/IO/api/consoleWith.cjs.map +1 -1
  229. package/_cjs/IO/api/daemonChildren.cjs +1 -2
  230. package/_cjs/IO/api/daemonChildren.cjs.map +1 -1
  231. package/_cjs/IO/api/delay.cjs +1 -2
  232. package/_cjs/IO/api/delay.cjs.map +1 -1
  233. package/_cjs/IO/api/descriptor.cjs +1 -2
  234. package/_cjs/IO/api/descriptor.cjs.map +1 -1
  235. package/_cjs/IO/api/diffFiberRefs.cjs +1 -2
  236. package/_cjs/IO/api/diffFiberRefs.cjs.map +1 -1
  237. package/_cjs/IO/api/disconnect.cjs +2 -3
  238. package/_cjs/IO/api/disconnect.cjs.map +1 -1
  239. package/_cjs/IO/api/ensuringChildren.cjs +1 -2
  240. package/_cjs/IO/api/ensuringChildren.cjs.map +1 -1
  241. package/_cjs/IO/api/environment.cjs +1 -2
  242. package/_cjs/IO/api/environment.cjs.map +1 -1
  243. package/_cjs/IO/api/foreachConcurrent.cjs +36 -30
  244. package/_cjs/IO/api/foreachConcurrent.cjs.map +1 -1
  245. package/_cjs/IO/api/foreachExec.cjs +30 -6
  246. package/_cjs/IO/api/foreachExec.cjs.map +1 -1
  247. package/_cjs/IO/api/fork.cjs +2 -3
  248. package/_cjs/IO/api/fork.cjs.map +1 -1
  249. package/_cjs/IO/api/forkAll.cjs +1 -2
  250. package/_cjs/IO/api/forkAll.cjs.map +1 -1
  251. package/_cjs/IO/api/forkDaemon.cjs +5 -6
  252. package/_cjs/IO/api/forkDaemon.cjs.map +1 -1
  253. package/_cjs/IO/api/forkIn.cjs +1 -2
  254. package/_cjs/IO/api/forkIn.cjs.map +1 -1
  255. package/_cjs/IO/api/forkScoped.cjs +1 -2
  256. package/_cjs/IO/api/forkScoped.cjs.map +1 -1
  257. package/_cjs/IO/api/fulfill.cjs +1 -2
  258. package/_cjs/IO/api/fulfill.cjs.map +1 -1
  259. package/_cjs/IO/api/interrupt.cjs +4 -5
  260. package/_cjs/IO/api/interrupt.cjs.map +1 -1
  261. package/_cjs/IO/api/memoize.cjs +1 -2
  262. package/_cjs/IO/api/memoize.cjs.map +1 -1
  263. package/_cjs/IO/api/onTermination.cjs +2 -3
  264. package/_cjs/IO/api/onTermination.cjs.map +1 -1
  265. package/_cjs/IO/api/once.cjs +1 -2
  266. package/_cjs/IO/api/once.cjs.map +1 -1
  267. package/_cjs/IO/api/patchFiberRefs.cjs +1 -2
  268. package/_cjs/IO/api/patchFiberRefs.cjs.map +1 -1
  269. package/_cjs/IO/api/provideLayer.cjs +1 -2
  270. package/_cjs/IO/api/provideLayer.cjs.map +1 -1
  271. package/_cjs/IO/api/provideScope.cjs +1 -2
  272. package/_cjs/IO/api/provideScope.cjs.map +1 -1
  273. package/_cjs/IO/api/provideSomeLayer.cjs +1 -2
  274. package/_cjs/IO/api/provideSomeLayer.cjs.map +1 -1
  275. package/_cjs/IO/api/provideSomeRuntime.cjs +1 -2
  276. package/_cjs/IO/api/provideSomeRuntime.cjs.map +1 -1
  277. package/_cjs/IO/api/race.cjs +2 -3
  278. package/_cjs/IO/api/race.cjs.map +1 -1
  279. package/_cjs/IO/api/raceFirst.cjs +1 -2
  280. package/_cjs/IO/api/raceFirst.cjs.map +1 -1
  281. package/_cjs/IO/api/raceWith.cjs +1 -2
  282. package/_cjs/IO/api/raceWith.cjs.map +1 -1
  283. package/_cjs/IO/api/randomWith.cjs +1 -2
  284. package/_cjs/IO/api/randomWith.cjs.map +1 -1
  285. package/_cjs/IO/api/repeat.cjs +1 -2
  286. package/_cjs/IO/api/repeat.cjs.map +1 -1
  287. package/_cjs/IO/api/retry.cjs +1 -2
  288. package/_cjs/IO/api/retry.cjs.map +1 -1
  289. package/_cjs/IO/api/schedule.cjs +1 -2
  290. package/_cjs/IO/api/schedule.cjs.map +1 -1
  291. package/_cjs/IO/api/scope.cjs +1 -2
  292. package/_cjs/IO/api/scope.cjs.map +1 -1
  293. package/_cjs/IO/api/scopeWith.cjs +1 -2
  294. package/_cjs/IO/api/scopeWith.cjs.map +1 -1
  295. package/_cjs/IO/api/scoped.cjs +1 -2
  296. package/_cjs/IO/api/scoped.cjs.map +1 -1
  297. package/_cjs/IO/api/sleep.cjs +1 -2
  298. package/_cjs/IO/api/sleep.cjs.map +1 -1
  299. package/_cjs/IO/api/stateful.cjs +1 -2
  300. package/_cjs/IO/api/stateful.cjs.map +1 -1
  301. package/_cjs/IO/api/supervised.cjs +1 -2
  302. package/_cjs/IO/api/supervised.cjs.map +1 -1
  303. package/_cjs/IO/api/timeout.cjs +9 -11
  304. package/_cjs/IO/api/timeout.cjs.map +1 -1
  305. package/_cjs/IO/api/transplant.cjs +22 -7
  306. package/_cjs/IO/api/transplant.cjs.map +1 -1
  307. package/_cjs/IO/api/whenFiberRef.cjs +1 -2
  308. package/_cjs/IO/api/whenFiberRef.cjs.map +1 -1
  309. package/_cjs/IO/api/whenRef.cjs +1 -2
  310. package/_cjs/IO/api/whenRef.cjs.map +1 -1
  311. package/_cjs/IO/api/withChildren.cjs +1 -2
  312. package/_cjs/IO/api/withChildren.cjs.map +1 -1
  313. package/_cjs/IO/api/withEarlyRelease.cjs +1 -2
  314. package/_cjs/IO/api/withEarlyRelease.cjs.map +1 -1
  315. package/_cjs/IO/api/withFinalizer.cjs +1 -2
  316. package/_cjs/IO/api/withFinalizer.cjs.map +1 -1
  317. package/_cjs/IO/api/withFinalizerExit.cjs +1 -2
  318. package/_cjs/IO/api/withFinalizerExit.cjs.map +1 -1
  319. package/_cjs/IO/api/zipConcurrent.cjs +5 -6
  320. package/_cjs/IO/api/zipConcurrent.cjs.map +1 -1
  321. package/_cjs/IO/api.cjs +522 -473
  322. package/_cjs/IO/api.cjs.map +1 -1
  323. package/_cjs/IO/definition.cjs +2 -3
  324. package/_cjs/IO/definition.cjs.map +1 -1
  325. package/_cjs/IO/runtime.cjs +9 -10
  326. package/_cjs/IO/runtime.cjs.map +1 -1
  327. package/_cjs/IO.cjs +33 -11
  328. package/_cjs/IO.cjs.map +1 -1
  329. package/_cjs/IOEnv/definition.cjs +1 -2
  330. package/_cjs/IOEnv/definition.cjs.map +1 -1
  331. package/_cjs/IOEnv/live.cjs +1 -2
  332. package/_cjs/IOEnv/live.cjs.map +1 -1
  333. package/_cjs/IOEnv/services.cjs +1 -2
  334. package/_cjs/IOEnv/services.cjs.map +1 -1
  335. package/_cjs/Layer/MemoMap.cjs +1 -2
  336. package/_cjs/Layer/MemoMap.cjs.map +1 -1
  337. package/_cjs/Layer/api.cjs +1 -2
  338. package/_cjs/Layer/api.cjs.map +1 -1
  339. package/_cjs/Logger/api.cjs +1 -2
  340. package/_cjs/Logger/api.cjs.map +1 -1
  341. package/_cjs/Logger/constructors.cjs +1 -2
  342. package/_cjs/Logger/constructors.cjs.map +1 -1
  343. package/_cjs/MVar/api.cjs +1 -2
  344. package/_cjs/MVar/api.cjs.map +1 -1
  345. package/_cjs/Push/Bounds.cjs +2 -0
  346. package/_cjs/Push/Bounds.cjs.map +1 -0
  347. package/_cjs/Push/FlattenStrategy.cjs +95 -0
  348. package/_cjs/Push/FlattenStrategy.cjs.map +1 -0
  349. package/_cjs/Push/IndexedBuffer.cjs +70 -0
  350. package/_cjs/Push/IndexedBuffer.cjs.map +1 -0
  351. package/_cjs/Push/MergeStrategy.cjs +45 -0
  352. package/_cjs/Push/MergeStrategy.cjs.map +1 -0
  353. package/_cjs/Push/Operator/IOLoopOperator.cjs +225 -0
  354. package/_cjs/Push/Operator/IOLoopOperator.cjs.map +1 -0
  355. package/_cjs/Push/Operator/IOOperator.cjs +104 -0
  356. package/_cjs/Push/Operator/IOOperator.cjs.map +1 -0
  357. package/_cjs/Push/Operator/LoopOperator.cjs +165 -0
  358. package/_cjs/Push/Operator/LoopOperator.cjs.map +1 -0
  359. package/_cjs/Push/Operator/SyncOperator.cjs +78 -0
  360. package/_cjs/Push/Operator/SyncOperator.cjs.map +1 -0
  361. package/_cjs/Push/Operator.cjs +2 -0
  362. package/_cjs/Push/Operator.cjs.map +1 -0
  363. package/_cjs/Push/Producer/IOProducer.cjs +67 -0
  364. package/_cjs/Push/Producer/IOProducer.cjs.map +1 -0
  365. package/_cjs/Push/Producer/SyncProducer.cjs +107 -0
  366. package/_cjs/Push/Producer/SyncProducer.cjs.map +1 -0
  367. package/_cjs/Push/Producer.cjs +2 -0
  368. package/_cjs/Push/Producer.cjs.map +1 -0
  369. package/_cjs/Push/Sink.cjs +219 -0
  370. package/_cjs/Push/Sink.cjs.map +1 -0
  371. package/_cjs/Push/api.cjs +340 -385
  372. package/_cjs/Push/api.cjs.map +1 -1
  373. package/_cjs/Push/definition.cjs +79 -22
  374. package/_cjs/Push/definition.cjs.map +1 -1
  375. package/_cjs/Push/internal.cjs +32 -28
  376. package/_cjs/Push/internal.cjs.map +1 -1
  377. package/_cjs/Push.cjs +66 -0
  378. package/_cjs/Push.cjs.map +1 -1
  379. package/_cjs/Queue/api/dimapIO.cjs +1 -2
  380. package/_cjs/Queue/api/dimapIO.cjs.map +1 -1
  381. package/_cjs/Queue/api/filterInputIO.cjs +1 -2
  382. package/_cjs/Queue/api/filterInputIO.cjs.map +1 -1
  383. package/_cjs/Queue/api/filterOutputIO.cjs +1 -2
  384. package/_cjs/Queue/api/filterOutputIO.cjs.map +1 -1
  385. package/_cjs/Queue/api/poll.cjs +1 -2
  386. package/_cjs/Queue/api/poll.cjs.map +1 -1
  387. package/_cjs/Queue/api/takeBetween.cjs +1 -2
  388. package/_cjs/Queue/api/takeBetween.cjs.map +1 -1
  389. package/_cjs/Queue/api/takeN.cjs +1 -2
  390. package/_cjs/Queue/api/takeN.cjs.map +1 -1
  391. package/_cjs/Queue/api/zipWithIO.cjs +1 -2
  392. package/_cjs/Queue/api/zipWithIO.cjs.map +1 -1
  393. package/_cjs/Queue/constructors.cjs +1 -2
  394. package/_cjs/Queue/constructors.cjs.map +1 -1
  395. package/_cjs/Queue/internal.cjs +1 -2
  396. package/_cjs/Queue/internal.cjs.map +1 -1
  397. package/_cjs/Queue/strategy.cjs +1 -2
  398. package/_cjs/Queue/strategy.cjs.map +1 -1
  399. package/_cjs/Random/api.cjs +1 -2
  400. package/_cjs/Random/api.cjs.map +1 -1
  401. package/_cjs/Random/definition.cjs +2 -2
  402. package/_cjs/Random/definition.cjs.map +1 -1
  403. package/_cjs/Random/live.cjs +1 -2
  404. package/_cjs/Random/live.cjs.map +1 -1
  405. package/_cjs/Ref/Atomic.cjs +1 -2
  406. package/_cjs/Ref/Atomic.cjs.map +1 -1
  407. package/_cjs/Ref/Derived.cjs +1 -2
  408. package/_cjs/Ref/Derived.cjs.map +1 -1
  409. package/_cjs/Ref/DerivedAll.cjs +1 -2
  410. package/_cjs/Ref/DerivedAll.cjs.map +1 -1
  411. package/_cjs/Ref/Synchronized/api.cjs +2 -3
  412. package/_cjs/Ref/Synchronized/api.cjs.map +1 -1
  413. package/_cjs/Ref/Synchronized/constructors.cjs +2 -3
  414. package/_cjs/Ref/Synchronized/constructors.cjs.map +1 -1
  415. package/_cjs/Ref/Synchronized/definition.cjs +13 -14
  416. package/_cjs/Ref/Synchronized/definition.cjs.map +1 -1
  417. package/_cjs/Ref/api/collect.cjs +1 -2
  418. package/_cjs/Ref/api/collect.cjs.map +1 -1
  419. package/_cjs/Ref/api/dimap.cjs +1 -2
  420. package/_cjs/Ref/api/dimap.cjs.map +1 -1
  421. package/_cjs/Ref/api/filter.cjs +1 -2
  422. package/_cjs/Ref/api/filter.cjs.map +1 -1
  423. package/_cjs/Ref/api/modify.cjs +1 -2
  424. package/_cjs/Ref/api/modify.cjs.map +1 -1
  425. package/_cjs/Ref/api.cjs +1 -2
  426. package/_cjs/Ref/api.cjs.map +1 -1
  427. package/_cjs/Ref/constructors.cjs +1 -2
  428. package/_cjs/Ref/constructors.cjs.map +1 -1
  429. package/_cjs/Ref/definition.cjs.map +1 -1
  430. package/_cjs/Reloadable/api.cjs +1 -2
  431. package/_cjs/Reloadable/api.cjs.map +1 -1
  432. package/_cjs/Reloadable/constructors.cjs +1 -2
  433. package/_cjs/Reloadable/constructors.cjs.map +1 -1
  434. package/_cjs/Reloadable/definition.cjs +1 -2
  435. package/_cjs/Reloadable/definition.cjs.map +1 -1
  436. package/_cjs/RuntimeFlags/Patch.cjs +1 -2
  437. package/_cjs/RuntimeFlags/Patch.cjs.map +1 -1
  438. package/_cjs/RuntimeFlags/RuntimeFlags.cjs +1 -2
  439. package/_cjs/RuntimeFlags/RuntimeFlags.cjs.map +1 -1
  440. package/_cjs/STM/api/atomically.cjs +1 -2
  441. package/_cjs/STM/api/atomically.cjs.map +1 -1
  442. package/_cjs/STM/api/core-api.cjs +1 -2
  443. package/_cjs/STM/api/core-api.cjs.map +1 -1
  444. package/_cjs/STM/api.cjs +1 -2
  445. package/_cjs/STM/api.cjs.map +1 -1
  446. package/_cjs/STM/definition.cjs +2 -3
  447. package/_cjs/STM/definition.cjs.map +1 -1
  448. package/_cjs/STM/driver.cjs +1 -2
  449. package/_cjs/STM/driver.cjs.map +1 -1
  450. package/_cjs/STM/internal/CommitState.cjs +1 -2
  451. package/_cjs/STM/internal/CommitState.cjs.map +1 -1
  452. package/_cjs/STM/internal/Journal.cjs +1 -2
  453. package/_cjs/STM/internal/Journal.cjs.map +1 -1
  454. package/_cjs/Schedule/Decision.cjs +1 -2
  455. package/_cjs/Schedule/Decision.cjs.map +1 -1
  456. package/_cjs/Schedule/api/driver.cjs +1 -2
  457. package/_cjs/Schedule/api/driver.cjs.map +1 -1
  458. package/_cjs/Schedule/api.cjs +1 -2
  459. package/_cjs/Schedule/api.cjs.map +1 -1
  460. package/_cjs/Scope/Finalizer/definition.cjs +1 -2
  461. package/_cjs/Scope/Finalizer/definition.cjs.map +1 -1
  462. package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +1 -2
  463. package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs.map +1 -1
  464. package/_cjs/Scope/ReleaseMap/api.cjs +1 -2
  465. package/_cjs/Scope/ReleaseMap/api.cjs.map +1 -1
  466. package/_cjs/Scope/ReleaseMap/constructors.cjs +1 -2
  467. package/_cjs/Scope/ReleaseMap/constructors.cjs.map +1 -1
  468. package/_cjs/Scope/ReleaseMap/definition.cjs +1 -2
  469. package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
  470. package/_cjs/Scope/api.cjs +29 -9
  471. package/_cjs/Scope/api.cjs.map +1 -1
  472. package/_cjs/Scope/definition.cjs +1 -2
  473. package/_cjs/Scope/definition.cjs.map +1 -1
  474. package/_cjs/ScopedRef/api.cjs +2 -3
  475. package/_cjs/ScopedRef/api.cjs.map +1 -1
  476. package/_cjs/Semaphore/Reservation.cjs +24 -0
  477. package/_cjs/Semaphore/Reservation.cjs.map +1 -0
  478. package/_cjs/Semaphore/constructors.cjs +25 -0
  479. package/_cjs/Semaphore/constructors.cjs.map +1 -0
  480. package/_cjs/Semaphore/definition.cjs +149 -0
  481. package/_cjs/Semaphore/definition.cjs.map +1 -0
  482. package/_cjs/Semaphore.cjs +31 -138
  483. package/_cjs/Semaphore.cjs.map +1 -1
  484. package/_cjs/Sink/api.cjs +1 -2
  485. package/_cjs/Sink/api.cjs.map +1 -1
  486. package/_cjs/Sink/definition.cjs +2 -3
  487. package/_cjs/Sink/definition.cjs.map +1 -1
  488. package/_cjs/State/api.cjs +1 -2
  489. package/_cjs/State/api.cjs.map +1 -1
  490. package/_cjs/Stream/api/zipAllWith.cjs +1 -2
  491. package/_cjs/Stream/api/zipAllWith.cjs.map +1 -1
  492. package/_cjs/Stream/api/zipWith.cjs +1 -2
  493. package/_cjs/Stream/api/zipWith.cjs.map +1 -1
  494. package/_cjs/Stream/api/zipWithChunks.cjs +1 -2
  495. package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -1
  496. package/_cjs/Stream/api.cjs +702 -703
  497. package/_cjs/Stream/api.cjs.map +1 -1
  498. package/_cjs/Stream/definition.cjs.map +1 -1
  499. package/_cjs/Stream/internal/Handoff.cjs +1 -2
  500. package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
  501. package/_cjs/Stream/internal/Pull.cjs +1 -2
  502. package/_cjs/Stream/internal/Pull.cjs.map +1 -1
  503. package/_cjs/Stream/internal/Take.cjs +1 -2
  504. package/_cjs/Stream/internal/Take.cjs.map +1 -1
  505. package/_cjs/Stream/internal/util.cjs +1 -2
  506. package/_cjs/Stream/internal/util.cjs.map +1 -1
  507. package/_cjs/Subject/Atomic.cjs +46 -12
  508. package/_cjs/Subject/Atomic.cjs.map +1 -1
  509. package/_cjs/Subject/DeferredRef.cjs +53 -0
  510. package/_cjs/Subject/DeferredRef.cjs.map +1 -0
  511. package/_cjs/Subject/Hold.cjs +41 -0
  512. package/_cjs/Subject/Hold.cjs.map +1 -0
  513. package/_cjs/Subject/RefSubject/Atomic.cjs +130 -0
  514. package/_cjs/Subject/RefSubject/Atomic.cjs.map +1 -0
  515. package/_cjs/Subject/RefSubject/Derived.cjs +98 -0
  516. package/_cjs/Subject/RefSubject/Derived.cjs.map +1 -0
  517. package/_cjs/Subject/RefSubject/RefSubject.cjs +19 -0
  518. package/_cjs/Subject/RefSubject/RefSubject.cjs.map +1 -0
  519. package/_cjs/Subject/api.cjs +1 -2
  520. package/_cjs/Subject/api.cjs.map +1 -1
  521. package/_cjs/Subject/definition.cjs +16 -1
  522. package/_cjs/Subject/definition.cjs.map +1 -1
  523. package/_cjs/Subject.cjs +22 -0
  524. package/_cjs/Subject.cjs.map +1 -1
  525. package/_cjs/SubscriptionRef.cjs +2 -4
  526. package/_cjs/SubscriptionRef.cjs.map +1 -1
  527. package/_cjs/Supervisor/api.cjs +1 -2
  528. package/_cjs/Supervisor/api.cjs.map +1 -1
  529. package/_cjs/Supervisor/constructors.cjs +1 -2
  530. package/_cjs/Supervisor/constructors.cjs.map +1 -1
  531. package/_cjs/Supervisor/definition.cjs +1 -2
  532. package/_cjs/Supervisor/definition.cjs.map +1 -1
  533. package/_cjs/SupervisorPatch.cjs +1 -2
  534. package/_cjs/SupervisorPatch.cjs.map +1 -1
  535. package/_cjs/TExit/definition.cjs +1 -2
  536. package/_cjs/TExit/definition.cjs.map +1 -1
  537. package/_cjs/TFuture/api.cjs +1 -2
  538. package/_cjs/TFuture/api.cjs.map +1 -1
  539. package/_cjs/TFuture/constructors.cjs +1 -2
  540. package/_cjs/TFuture/constructors.cjs.map +1 -1
  541. package/_cjs/TFuture/definition.cjs +1 -2
  542. package/_cjs/TFuture/definition.cjs.map +1 -1
  543. package/_cjs/TReentrantLock/api.cjs +1 -2
  544. package/_cjs/TReentrantLock/api.cjs.map +1 -1
  545. package/_cjs/TReentrantLock/definition.cjs +1 -2
  546. package/_cjs/TReentrantLock/definition.cjs.map +1 -1
  547. package/_cjs/TRef/api.cjs +1 -2
  548. package/_cjs/TRef/api.cjs.map +1 -1
  549. package/_cjs/TRef/constructors.cjs +1 -2
  550. package/_cjs/TRef/constructors.cjs.map +1 -1
  551. package/_cjs/TRef/definition.cjs +1 -2
  552. package/_cjs/TRef/definition.cjs.map +1 -1
  553. package/_cjs/TSemaphore/api.cjs +1 -2
  554. package/_cjs/TSemaphore/api.cjs.map +1 -1
  555. package/_cjs/TSemaphore/constructors.cjs +1 -2
  556. package/_cjs/TSemaphore/constructors.cjs.map +1 -1
  557. package/_cjs/TSemaphore/definition.cjs +1 -2
  558. package/_cjs/TSemaphore/definition.cjs.map +1 -1
  559. package/_cjs/collection/immutable/Conc/dropUntilIO.cjs +1 -2
  560. package/_cjs/collection/immutable/Conc/dropUntilIO.cjs.map +1 -1
  561. package/_cjs/collection/immutable/Conc/dropWhileIO.cjs +1 -2
  562. package/_cjs/collection/immutable/Conc/dropWhileIO.cjs.map +1 -1
  563. package/_cjs/collection/immutable/Conc/filterIO.cjs +1 -2
  564. package/_cjs/collection/immutable/Conc/filterIO.cjs.map +1 -1
  565. package/_cjs/collection/immutable/Conc/findIO.cjs +1 -2
  566. package/_cjs/collection/immutable/Conc/findIO.cjs.map +1 -1
  567. package/_cjs/collection/immutable/Conc/mapIO.cjs +1 -2
  568. package/_cjs/collection/immutable/Conc/mapIO.cjs.map +1 -1
  569. package/_cjs/collection/immutable/Conc/takeWhileIO.cjs +1 -2
  570. package/_cjs/collection/immutable/Conc/takeWhileIO.cjs.map +1 -1
  571. package/_cjs/data/Exit/foreachIO.cjs +1 -2
  572. package/_cjs/data/Exit/foreachIO.cjs.map +1 -1
  573. package/_cjs/internal/HashedPair.cjs +1 -2
  574. package/_cjs/internal/HashedPair.cjs.map +1 -1
  575. package/_cjs/internal/Hub.cjs +1 -2
  576. package/_cjs/internal/Hub.cjs.map +1 -1
  577. package/_cjs/internal/MutableQueue.cjs +1 -2
  578. package/_cjs/internal/MutableQueue.cjs.map +1 -1
  579. package/_cjs/internal/Scheduler.cjs +1 -2
  580. package/_cjs/internal/Scheduler.cjs.map +1 -1
  581. package/_cjs/internal/StackTraceBuilder.cjs +1 -2
  582. package/_cjs/internal/StackTraceBuilder.cjs.map +1 -1
  583. package/_mjs/Cached/api.mjs.map +1 -1
  584. package/_mjs/Channel/api/mapOutConcurrentIO.mjs +1 -1
  585. package/_mjs/Channel/api/mergeAllWith.mjs +1 -1
  586. package/_mjs/Channel/api/runScoped.mjs +2 -2
  587. package/_mjs/Channel/api/runScoped.mjs.map +1 -1
  588. package/_mjs/Channel/api/toPull.mjs +1 -1
  589. package/_mjs/Channel/api/toPull.mjs.map +1 -1
  590. package/_mjs/Channel/api.mjs +205 -205
  591. package/_mjs/Channel/api.mjs.map +1 -1
  592. package/_mjs/Channel/core-api.mjs +43 -42
  593. package/_mjs/Channel/core-api.mjs.map +1 -1
  594. package/_mjs/Channel/internal/ChannelExecutor.mjs +3 -3
  595. package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
  596. package/_mjs/Console/definition.mjs +1 -0
  597. package/_mjs/Console/definition.mjs.map +1 -1
  598. package/_mjs/CountdownLatch.mjs +2 -1
  599. package/_mjs/CountdownLatch.mjs.map +1 -1
  600. package/_mjs/Fiber/FiberMessage.mjs +2 -20
  601. package/_mjs/Fiber/FiberMessage.mjs.map +1 -1
  602. package/_mjs/Fiber/FiberRuntime.mjs +877 -633
  603. package/_mjs/Fiber/FiberRuntime.mjs.map +1 -1
  604. package/_mjs/Fiber/api/collectAll.mjs +1 -1
  605. package/_mjs/Fiber/api/collectAll.mjs.map +1 -1
  606. package/_mjs/Fiber/api/interrupt.mjs +1 -1
  607. package/_mjs/Fiber/api/interrupt.mjs.map +1 -1
  608. package/_mjs/Fiber/api/interruptAll.mjs +1 -1
  609. package/_mjs/Fiber/api/interruptAll.mjs.map +1 -1
  610. package/_mjs/Fiber/api/interruptAs.mjs +4 -7
  611. package/_mjs/Fiber/api/interruptAs.mjs.map +1 -1
  612. package/_mjs/Fiber/api/interruptFork.mjs +1 -1
  613. package/_mjs/Fiber/api/interruptFork.mjs.map +1 -1
  614. package/_mjs/Fiber/api/mapIO.mjs +1 -1
  615. package/_mjs/Fiber/api/mapIO.mjs.map +1 -1
  616. package/_mjs/Fiber/api/zipWith.mjs +1 -1
  617. package/_mjs/Fiber/api/zipWith.mjs.map +1 -1
  618. package/_mjs/Fiber/constructors.mjs +1 -1
  619. package/_mjs/Fiber/constructors.mjs.map +1 -1
  620. package/_mjs/Fiber/definition.mjs +5 -2
  621. package/_mjs/Fiber/definition.mjs.map +1 -1
  622. package/_mjs/FiberScope/definition.mjs +28 -4
  623. package/_mjs/FiberScope/definition.mjs.map +1 -1
  624. package/_mjs/FiberSet.mjs +14 -12
  625. package/_mjs/FiberSet.mjs.map +1 -1
  626. package/_mjs/Future/State.mjs +96 -0
  627. package/_mjs/Future/State.mjs.map +1 -0
  628. package/_mjs/Future/api.mjs +67 -61
  629. package/_mjs/Future/api.mjs.map +1 -1
  630. package/_mjs/Future/constructors.mjs +3 -3
  631. package/_mjs/Future/constructors.mjs.map +1 -1
  632. package/_mjs/Future/definition.mjs +0 -12
  633. package/_mjs/Future/definition.mjs.map +1 -1
  634. package/_mjs/Future.mjs +1 -0
  635. package/_mjs/Future.mjs.map +1 -1
  636. package/_mjs/Hub/api.mjs +55 -55
  637. package/_mjs/Hub/api.mjs.map +1 -1
  638. package/_mjs/IO/api/array.mjs +42 -0
  639. package/_mjs/IO/api/array.mjs.map +1 -0
  640. package/_mjs/IO/api/asyncInterrupt.mjs.map +1 -1
  641. package/_mjs/IO/api/awaitAllChildren.mjs +10 -0
  642. package/_mjs/IO/api/awaitAllChildren.mjs.map +1 -0
  643. package/_mjs/IO/api/cachedInvalidate.mjs +39 -0
  644. package/_mjs/IO/api/cachedInvalidate.mjs.map +1 -0
  645. package/_mjs/IO/api/disconnect.mjs +1 -1
  646. package/_mjs/IO/api/disconnect.mjs.map +1 -1
  647. package/_mjs/IO/api/foreachConcurrent.mjs +35 -28
  648. package/_mjs/IO/api/foreachConcurrent.mjs.map +1 -1
  649. package/_mjs/IO/api/foreachExec.mjs +27 -4
  650. package/_mjs/IO/api/foreachExec.mjs.map +1 -1
  651. package/_mjs/IO/api/fork.mjs +1 -1
  652. package/_mjs/IO/api/fork.mjs.map +1 -1
  653. package/_mjs/IO/api/forkDaemon.mjs +4 -4
  654. package/_mjs/IO/api/forkDaemon.mjs.map +1 -1
  655. package/_mjs/IO/api/interrupt.mjs +3 -3
  656. package/_mjs/IO/api/onTermination.mjs +1 -1
  657. package/_mjs/IO/api/onTermination.mjs.map +1 -1
  658. package/_mjs/IO/api/race.mjs +1 -1
  659. package/_mjs/IO/api/race.mjs.map +1 -1
  660. package/_mjs/IO/api/timeout.mjs +8 -9
  661. package/_mjs/IO/api/timeout.mjs.map +1 -1
  662. package/_mjs/IO/api/transplant.mjs +19 -5
  663. package/_mjs/IO/api/transplant.mjs.map +1 -1
  664. package/_mjs/IO/api/zipConcurrent.mjs +4 -4
  665. package/_mjs/IO/api/zipConcurrent.mjs.map +1 -1
  666. package/_mjs/IO/api.mjs +515 -468
  667. package/_mjs/IO/api.mjs.map +1 -1
  668. package/_mjs/IO/definition.mjs +1 -1
  669. package/_mjs/IO/definition.mjs.map +1 -1
  670. package/_mjs/IO/runtime.mjs +8 -8
  671. package/_mjs/IO/runtime.mjs.map +1 -1
  672. package/_mjs/IO.mjs +3 -1
  673. package/_mjs/IO.mjs.map +1 -1
  674. package/_mjs/IOEnv/definition.mjs.map +1 -1
  675. package/_mjs/Push/Bounds.mjs +2 -0
  676. package/_mjs/Push/Bounds.mjs.map +1 -0
  677. package/_mjs/Push/FlattenStrategy.mjs +86 -0
  678. package/_mjs/Push/FlattenStrategy.mjs.map +1 -0
  679. package/_mjs/Push/IndexedBuffer.mjs +61 -0
  680. package/_mjs/Push/IndexedBuffer.mjs.map +1 -0
  681. package/_mjs/Push/MergeStrategy.mjs +34 -0
  682. package/_mjs/Push/MergeStrategy.mjs.map +1 -0
  683. package/_mjs/Push/Operator/IOLoopOperator.mjs +208 -0
  684. package/_mjs/Push/Operator/IOLoopOperator.mjs.map +1 -0
  685. package/_mjs/Push/Operator/IOOperator.mjs +91 -0
  686. package/_mjs/Push/Operator/IOOperator.mjs.map +1 -0
  687. package/_mjs/Push/Operator/LoopOperator.mjs +151 -0
  688. package/_mjs/Push/Operator/LoopOperator.mjs.map +1 -0
  689. package/_mjs/Push/Operator/SyncOperator.mjs +67 -0
  690. package/_mjs/Push/Operator/SyncOperator.mjs.map +1 -0
  691. package/_mjs/Push/Operator.mjs +2 -0
  692. package/_mjs/Push/Operator.mjs.map +1 -0
  693. package/_mjs/Push/Producer/IOProducer.mjs +55 -0
  694. package/_mjs/Push/Producer/IOProducer.mjs.map +1 -0
  695. package/_mjs/Push/Producer/SyncProducer.mjs +90 -0
  696. package/_mjs/Push/Producer/SyncProducer.mjs.map +1 -0
  697. package/_mjs/Push/Producer.mjs +2 -0
  698. package/_mjs/Push/Producer.mjs.map +1 -0
  699. package/_mjs/Push/Sink.mjs +206 -0
  700. package/_mjs/Push/Sink.mjs.map +1 -0
  701. package/_mjs/Push/api.mjs +311 -344
  702. package/_mjs/Push/api.mjs.map +1 -1
  703. package/_mjs/Push/definition.mjs +73 -18
  704. package/_mjs/Push/definition.mjs.map +1 -1
  705. package/_mjs/Push/internal.mjs +30 -26
  706. package/_mjs/Push/internal.mjs.map +1 -1
  707. package/_mjs/Push.mjs +7 -1
  708. package/_mjs/Push.mjs.map +1 -1
  709. package/_mjs/Random/definition.mjs +1 -0
  710. package/_mjs/Random/definition.mjs.map +1 -1
  711. package/_mjs/Ref/Synchronized/api.mjs +1 -1
  712. package/_mjs/Ref/Synchronized/api.mjs.map +1 -1
  713. package/_mjs/Ref/Synchronized/constructors.mjs +1 -1
  714. package/_mjs/Ref/Synchronized/definition.mjs +12 -12
  715. package/_mjs/Ref/Synchronized/definition.mjs.map +1 -1
  716. package/_mjs/Ref/definition.mjs.map +1 -1
  717. package/_mjs/STM/definition.mjs +1 -1
  718. package/_mjs/Scope/api.mjs +22 -4
  719. package/_mjs/Scope/api.mjs.map +1 -1
  720. package/_mjs/ScopedRef/api.mjs +1 -1
  721. package/_mjs/ScopedRef/api.mjs.map +1 -1
  722. package/_mjs/Semaphore/Reservation.mjs +16 -0
  723. package/_mjs/Semaphore/Reservation.mjs.map +1 -0
  724. package/_mjs/Semaphore/constructors.mjs +17 -0
  725. package/_mjs/Semaphore/constructors.mjs.map +1 -0
  726. package/_mjs/Semaphore/definition.mjs +141 -0
  727. package/_mjs/Semaphore/definition.mjs.map +1 -0
  728. package/_mjs/Semaphore.mjs +4 -133
  729. package/_mjs/Semaphore.mjs.map +1 -1
  730. package/_mjs/Sink/definition.mjs +2 -3
  731. package/_mjs/Sink/definition.mjs.map +1 -1
  732. package/_mjs/Stream/api.mjs +701 -701
  733. package/_mjs/Stream/api.mjs.map +1 -1
  734. package/_mjs/Stream/definition.mjs.map +1 -1
  735. package/_mjs/Subject/Atomic.mjs +46 -10
  736. package/_mjs/Subject/Atomic.mjs.map +1 -1
  737. package/_mjs/Subject/DeferredRef.mjs +45 -0
  738. package/_mjs/Subject/DeferredRef.mjs.map +1 -0
  739. package/_mjs/Subject/Hold.mjs +33 -0
  740. package/_mjs/Subject/Hold.mjs.map +1 -0
  741. package/_mjs/Subject/RefSubject/Atomic.mjs +122 -0
  742. package/_mjs/Subject/RefSubject/Atomic.mjs.map +1 -0
  743. package/_mjs/Subject/RefSubject/Derived.mjs +90 -0
  744. package/_mjs/Subject/RefSubject/Derived.mjs.map +1 -0
  745. package/_mjs/Subject/RefSubject/RefSubject.mjs +12 -0
  746. package/_mjs/Subject/RefSubject/RefSubject.mjs.map +1 -0
  747. package/_mjs/Subject/definition.mjs +14 -0
  748. package/_mjs/Subject/definition.mjs.map +1 -1
  749. package/_mjs/Subject.mjs +2 -0
  750. package/_mjs/Subject.mjs.map +1 -1
  751. package/_mjs/SubscriptionRef.mjs +1 -2
  752. package/_mjs/SubscriptionRef.mjs.map +1 -1
  753. package/_src/Cached/api.ts +3 -3
  754. package/_src/Channel/api/toPull.ts +1 -1
  755. package/_src/Channel/api.ts +273 -272
  756. package/_src/Channel/core-api.ts +57 -55
  757. package/_src/Channel/internal/ChannelExecutor.ts +3 -3
  758. package/_src/Console/definition.ts +1 -0
  759. package/_src/CountdownLatch.ts +2 -0
  760. package/_src/Fiber/FiberMessage.ts +3 -28
  761. package/_src/Fiber/FiberRuntime.ts +988 -616
  762. package/_src/Fiber/api/interruptAs.ts +4 -3
  763. package/_src/Fiber/constructors.ts +1 -1
  764. package/_src/Fiber/definition.ts +4 -0
  765. package/_src/FiberScope/definition.ts +40 -2
  766. package/_src/FiberSet.ts +6 -2
  767. package/_src/Future/State.ts +128 -0
  768. package/_src/Future/api.ts +62 -51
  769. package/_src/Future/constructors.ts +4 -2
  770. package/_src/Future/definition.ts +2 -17
  771. package/_src/Future.ts +4 -3
  772. package/_src/Hub/api.ts +61 -61
  773. package/_src/IO/api/addFinalizerExit.ts +4 -4
  774. package/_src/IO/api/array.ts +49 -0
  775. package/_src/IO/api/asyncInterrupt.ts +1 -1
  776. package/_src/IO/api/awaitAllChildren.ts +6 -0
  777. package/_src/IO/api/cachedInvalidate.ts +42 -0
  778. package/_src/IO/api/foreachConcurrent.ts +39 -23
  779. package/_src/IO/api/foreachExec.ts +47 -0
  780. package/_src/IO/api/fork.ts +1 -1
  781. package/_src/IO/api/forkDaemon.ts +2 -2
  782. package/_src/IO/api/memoize.ts +3 -3
  783. package/_src/IO/api/onTermination.ts +2 -2
  784. package/_src/IO/api/transplant.ts +26 -3
  785. package/_src/IO/api/zipConcurrent.ts +2 -2
  786. package/_src/IO/api.ts +547 -525
  787. package/_src/IO/definition.ts +4 -28
  788. package/_src/IO/runtime.ts +0 -1
  789. package/_src/IO.ts +65 -63
  790. package/_src/IOEnv/definition.ts +1 -4
  791. package/_src/Push/Bounds.ts +4 -0
  792. package/_src/Push/FlattenStrategy.ts +137 -0
  793. package/_src/Push/IndexedBuffer.ts +79 -0
  794. package/_src/Push/MergeStrategy.ts +59 -0
  795. package/_src/Push/Operator/IOLoopOperator.ts +413 -0
  796. package/_src/Push/Operator/IOOperator.ts +173 -0
  797. package/_src/Push/Operator/LoopOperator.ts +242 -0
  798. package/_src/Push/Operator/SyncOperator.ts +107 -0
  799. package/_src/Push/Operator.ts +7 -0
  800. package/_src/Push/Producer/IOProducer.ts +83 -0
  801. package/_src/Push/Producer/SyncProducer.ts +105 -0
  802. package/_src/Push/Producer.ts +0 -0
  803. package/_src/Push/Sink.ts +302 -0
  804. package/_src/Push/api.ts +387 -513
  805. package/_src/Push/definition.ts +216 -23
  806. package/_src/Push/internal.ts +11 -0
  807. package/_src/Push.ts +7 -1
  808. package/_src/Random/definition.ts +1 -0
  809. package/_src/Ref/Synchronized/api.ts +2 -2
  810. package/_src/Ref/Synchronized/definition.ts +82 -38
  811. package/_src/Ref/definition.ts +26 -0
  812. package/_src/Scope/api.ts +22 -0
  813. package/_src/Semaphore/Reservation.ts +15 -0
  814. package/_src/Semaphore/constructors.ts +14 -0
  815. package/_src/Semaphore/definition.ts +180 -0
  816. package/_src/Semaphore.ts +5 -159
  817. package/_src/Sink/definition.ts +4 -5
  818. package/_src/Stream/api.ts +679 -679
  819. package/_src/Stream/definition.ts +0 -1
  820. package/_src/Subject/Atomic.ts +68 -11
  821. package/_src/Subject/DeferredRef.ts +44 -0
  822. package/_src/Subject/Hold.ts +48 -0
  823. package/_src/Subject/RefSubject/Atomic.ts +193 -0
  824. package/_src/Subject/RefSubject/Derived.ts +179 -0
  825. package/_src/Subject/RefSubject/RefSubject.ts +90 -0
  826. package/_src/Subject/definition.ts +21 -3
  827. package/_src/Subject.ts +5 -3
  828. package/_src/SubscriptionRef.ts +1 -1
  829. package/_src/index.ts +49 -50
  830. package/index.d.ts +0 -1
  831. package/package.json +4 -4
  832. package/IO/api/sequenceT.d.ts +0 -26
  833. package/RefSubject/Atomic.d.ts +0 -34
  834. package/RefSubject/Synchronized/api.d.ts +0 -9
  835. package/RefSubject/Synchronized/definition.d.ts +0 -39
  836. package/RefSubject/api.d.ts +0 -120
  837. package/RefSubject/definition.d.ts +0 -52
  838. package/RefSubject.d.ts +0 -3
  839. package/_cjs/IO/api/sequenceT.cjs +0 -18
  840. package/_cjs/IO/api/sequenceT.cjs.map +0 -1
  841. package/_cjs/RefSubject/Atomic.cjs +0 -108
  842. package/_cjs/RefSubject/Atomic.cjs.map +0 -1
  843. package/_cjs/RefSubject/Synchronized/api.cjs +0 -23
  844. package/_cjs/RefSubject/Synchronized/api.cjs.map +0 -1
  845. package/_cjs/RefSubject/Synchronized/definition.cjs +0 -56
  846. package/_cjs/RefSubject/Synchronized/definition.cjs.map +0 -1
  847. package/_cjs/RefSubject/api.cjs +0 -252
  848. package/_cjs/RefSubject/api.cjs.map +0 -1
  849. package/_cjs/RefSubject/definition.cjs +0 -26
  850. package/_cjs/RefSubject/definition.cjs.map +0 -1
  851. package/_cjs/RefSubject.cjs +0 -39
  852. package/_cjs/RefSubject.cjs.map +0 -1
  853. package/_mjs/IO/api/sequenceT.mjs +0 -10
  854. package/_mjs/IO/api/sequenceT.mjs.map +0 -1
  855. package/_mjs/RefSubject/Atomic.mjs +0 -99
  856. package/_mjs/RefSubject/Atomic.mjs.map +0 -1
  857. package/_mjs/RefSubject/Synchronized/api.mjs +0 -15
  858. package/_mjs/RefSubject/Synchronized/api.mjs.map +0 -1
  859. package/_mjs/RefSubject/Synchronized/definition.mjs +0 -47
  860. package/_mjs/RefSubject/Synchronized/definition.mjs.map +0 -1
  861. package/_mjs/RefSubject/api.mjs +0 -229
  862. package/_mjs/RefSubject/api.mjs.map +0 -1
  863. package/_mjs/RefSubject/definition.mjs +0 -19
  864. package/_mjs/RefSubject/definition.mjs.map +0 -1
  865. package/_mjs/RefSubject.mjs +0 -5
  866. package/_mjs/RefSubject.mjs.map +0 -1
  867. package/_src/IO/api/sequenceT.ts +0 -16
  868. package/_src/RefSubject/Atomic.ts +0 -129
  869. package/_src/RefSubject/Synchronized/api.ts +0 -14
  870. package/_src/RefSubject/Synchronized/definition.ts +0 -76
  871. package/_src/RefSubject/api.ts +0 -253
  872. package/_src/RefSubject/definition.ts +0 -70
  873. package/_src/RefSubject.ts +0 -5
@@ -28,7 +28,7 @@ class Synch extends tsplus_module_9.ScopedRef {
28
28
  this.get = tsplus_module_2.map(([_, a]) => a, fileName_1 + ":42:33")(tsplus_module_10.get(this.ref, fileName_1 + ":42:25"));
29
29
  }
30
30
  set(acquire, __tsplusTrace) {
31
- return tsplus_module_2.flatten(tsplus_module_12.modifyIO(([oldScope, a]) => tsplus_module_8.uninterruptibleMask(restore => tsplus_module_2.flatMap(() => tsplus_module_2.flatMap(newScope => tsplus_module_2.flatMap(exit => tsplus_module_11.match(cause => tsplus_module_2.as(() => [tsplus_module_2.refailCause(cause, fileName_1 + ":34:61"), [oldScope, a]], fileName_1 + ":34:45")(newScope.close(() => tsplus_module_4.unit)), a => tsplus_module_2.succeedNow([tsplus_module_2.unit, [newScope, a]], fileName_1 + ":35:35"))(exit), fileName_1 + ":30:29")(tsplus_module_2.result(restore(tsplus_module_7.extend(() => acquire, fileName_1 + ":30:53")(newScope), fileName_1 + ":30:37"), fileName_1 + ":30:63")), fileName_1 + ":29:29")(tsplus_module_7.make), fileName_1 + ":28:12")(oldScope.close(() => tsplus_module_4.unit)), fileName_1 + ":26:29"), fileName_1 + ":25:29")(this.ref), fileName_1 + ":40:6");
31
+ return tsplus_module_2.flatten(tsplus_module_12.modifyIO(([oldScope, a]) => tsplus_module_8.uninterruptibleMask(restore => tsplus_module_2.flatMap(() => tsplus_module_2.flatMap(newScope => tsplus_module_2.flatMap(exit => tsplus_module_11.match(cause => tsplus_module_2.as(() => [tsplus_module_2.refailCause(() => cause, fileName_1 + ":34:61"), [oldScope, a]], fileName_1 + ":34:45")(newScope.close(() => tsplus_module_4.unit)), a => tsplus_module_2.succeedNow([tsplus_module_2.unit, [newScope, a]], fileName_1 + ":35:35"))(exit), fileName_1 + ":30:29")(tsplus_module_2.result(restore(tsplus_module_7.extend(() => acquire, fileName_1 + ":30:53")(newScope), fileName_1 + ":30:37"), fileName_1 + ":30:63")), fileName_1 + ":29:29")(tsplus_module_7.make), fileName_1 + ":28:12")(oldScope.close(() => tsplus_module_4.unit)), fileName_1 + ":26:29"), fileName_1 + ":25:29")(this.ref), fileName_1 + ":40:6");
32
32
  }
33
33
  }
34
34
  //# sourceMappingURL=api.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.mjs","names":["fromAcquire","acquire","__tsplusTrace","tsplus_module_8","uninterruptibleMask","restore","tsplus_module_2","flatMap","newScope","a","ref","scopedRef","Synch","tsplus_module_1","addFinalizer","close","tsplus_module_3","makeSynchronized","tapCause","cause","tsplus_module_4","fail","tsplus_module_6","provideSomeService","tsplus_module_5","ScopeTag","tsplus_module_7","make","tsplus_module_9","ScopedRef","constructor","scope","_","unit","fileName_1","tsplus_module_10","get","map","set","flatten","tsplus_module_12","modifyIO","oldScope","exit","tsplus_module_11","match","as","refailCause","succeedNow","result","extend"],"sources":["../../_src/ScopedRef/api.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;AAAA;;;AAGA,OAAM,SAAUA,WAAWA,CAAUC,OAAoB,EAAEC,aAAsB;EAC/E,OAAOC,eAAA,CAAAC,mBAAA,CAAwBC,OAAO,IAAIC,eAAA,CAAAC,OAAA,CAEhCC,QAAQ,IAAAF,eAAA,CAAAC,OAAA,CACRE,CAAC,IAAAH,eAAA,CAAAC,OAAA,CAGDG,GAAG;IACT,MAAMC,SAAS,GAAG,IAAIC,KAAK,CAACF,GAAG,CAAC;qCAEzBC,SAAS,EAVqCT,aAAA,EASnDW,eAAA,CAAAC,YAAA,OAAgBH,SAAS,CAACI,KAAK,EAToBb,aAAA,CASnB;KATmBA,aAAA,EAOjCc,eAAA,CAAAC,gBAAA,OAAsB,CAACT,QAAQ,EAAEC,CAAC,CAAU,EAPXP,aAAA,CAOY,GAPZA,aAAA,EAKnDG,OAAO,CAACC,eAAA,CAAAY,QAAA,CAA0DC,KAAK,IAAKX,QAAQ,CAACO,KAAK,OAACK,eAAA,CAAAC,IAAA,CAAUF,KAAK,EALvDjB,aAAA,CAKwD,CAAC,EALzDA,aAAA,EAK3CoB,eAAA,CAAAC,kBAAA,CAA2Bf,QAAQ,EAAAgB,eAAA,CAAAC,QAAA,EALQvB,aAAA,EAK3CD,OAAO,CAAwC,CAAsD,EAL1DC,aAAA,CAK2D,GAL3DA,a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A,CAAA0C,UAAA,CAAc,CAAA1C,eAAA,CAAA2B,IAAA,EAAU,CAACzB,QAAQ,EAAEC,CAAC,CAAC,CAAU,EAAAyB,UAAA,YAAC,EAHzDS,IAAI,CAIH,EAAAT,UAAA,aAAA5B,eAAA,CAAA2C,MAAA,CANgB5C,OAAO,CAACqB,eAAA,CAAAwB,MAAA,OAAgBjD,OAAO,EAAAiC,UAAA,aAAvB1B,QAAQ,CAAgB,EAAA0B,UAAA,YAAC,EAAAA,UAAA,eAAAA,UAAA,aAAAR,eAAA,CAAAC,IAAA,GAAAO,UAAA,aAFlDQ,QAAQ,CAAC3B,KAAK,OAAAK,eAAA,CAAAa,IAAA,CAAW,CAU3B,EAAAC,UAAA,YACH,EAAAA,UAAA,aAdI,IAAI,CAACxB,GAAG,CAed,EAAAwB,UAAA;EACH","ignoreList":[]}
1
+ {"version":3,"file":"api.mjs","names":["fromAcquire","acquire","__tsplusTrace","tsplus_module_8","uninterruptibleMask","restore","tsplus_module_2","flatMap","newScope","a","ref","scopedRef","Synch","tsplus_module_1","addFinalizer","close","tsplus_module_3","makeSynchronized","tapCause","cause","tsplus_module_4","fail","tsplus_module_6","provideSomeService","tsplus_module_5","ScopeTag","tsplus_module_7","make","tsplus_module_9","ScopedRef","constructor","scope","_","unit","fileName_1","tsplus_module_10","get","map","set","flatten","tsplus_module_12","modifyIO","oldScope","exit","tsplus_module_11","match","as","refailCause","succeedNow","result","extend"],"sources":["../../_src/ScopedRef/api.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;AAAA;;;AAGA,OAAM,SAAUA,WAAWA,CAAUC,OAAoB,EAAEC,aAAsB;EAC/E,OAAOC,eAAA,CAAAC,mBAAA,CAAwBC,OAAO,IAAIC,eAAA,CAAAC,OAAA,CAEhCC,QAAQ,IAAAF,eAAA,CAAAC,OAAA,CACRE,CAAC,IAAAH,eAAA,CAAAC,OAAA,CAGDG,GAAG;IACT,MAAMC,SAAS,GAAG,IAAIC,KAAK,CAACF,GA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AA,CAAAiC,OAAA,CAAOC,gBAAA,CAAAC,QAAA,CAAkB,CAAC,CAACC,QAAQ,EAAEjC,CAAC,CAAC,KACrCN,eAAA,CAAAC,mBAAA,CAAwBC,OAAO,IAAIC,eAAA,CAAAC,OAAA,OAAAD,eAAA,CAAAC,OAAA,CAGzBC,QAAQ,IAAAF,eAAA,CAAAC,OAAA,CACRoC,IAAI,IAERC,gBAAA,CAAAC,KAAA,CACG1B,KAAK,IACJb,eAAA,CAAAwC,EAAA,OAA6B,CAACxC,eAAA,CAAAyC,WAAA,OAAe5B,KAAK,EAAAe,UAAA,YAAC,EAAE,CAACQ,QAAQ,EAAEjC,CAAC,CAAC,CAAU,EAAAyB,UAAA,aAA5E1B,QAAQ,CAACO,KAAK,OAAAK,eAAA,CAAAa,IAAA,CAAW,CAAoD,EAC9ExB,CAAC,IAAKH,eAAA,CAAA0C,UAAA,CAAc,CAAA1C,eAAA,CAAA2B,IAAA,EAAU,CAACzB,QAAQ,EAAEC,CAAC,CAAC,CAAU,EAAAyB,UAAA,YAAC,EAHzDS,IAAI,CAIH,EAAAT,UAAA,aAAA5B,eAAA,CAAA2C,MAAA,CANgB5C,OAAO,CAACqB,eAAA,CAAAwB,MAAA,OAAgBjD,OAAO,EAAAiC,UAAA,aAAvB1B,QAAQ,CAAgB,EAAA0B,UAAA,YAAC,EAAAA,UAAA,eAAAA,UAAA,aAAAR,eAAA,CAAAC,IAAA,GAAAO,UAAA,aAFlDQ,QAAQ,CAAC3B,KAAK,OAAAK,eAAA,CAAAa,IAAA,CAAW,CAU3B,EAAAC,UAAA,YACH,EAAAA,UAAA,aAdI,IAAI,CAACxB,GAAG,CAed,EAAAwB,UAAA;EACH","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ import * as tsplus_module_1 from "@fncts/io/IO/api";
2
+ /**
3
+ * @tsplus type fncts.io.Semaphore.Reservation
4
+ * @tsplus companion fncts.io.Semaphore.ReservationOps
5
+ */
6
+ export class Reservation {
7
+ constructor(acquire, release) {
8
+ this.acquire = acquire;
9
+ this.release = release;
10
+ }
11
+ }
12
+ /**
13
+ * @tsplus static fncts.io.Semaphore.ReservationOps zero
14
+ */
15
+ export const zero = /*#__PURE__*/new Reservation(tsplus_module_1.unit, tsplus_module_1.unit);
16
+ //# sourceMappingURL=Reservation.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Reservation.mjs","names":["Reservation","constructor","acquire","release","zero","tsplus_module_1","unit"],"sources":["../../_src/Semaphore/Reservation.ts"],"sourcesContent":[null],"mappings":";AAAA;;;;AAIA,OAAM,MAAOA,WAAW;EACtBC,YACWC,OAAkB,EAClBC,OAAkB;IADlB,KAAAD,OAAO,GAAPA,OAAO;IACP,KAAAC,OAAO,GAAPA,OAAO;EACf;;AAGL;;;AAGA,OAAO,MAAMC,IAAI,gBAAG,IAAIJ,WAAW,CAAAK,eAAA,CAAAC,IAAA,EAAAD,eAAA,CAAAC,IAAA,CAAkB","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ import * as tsplus_module_1 from "@fncts/io/Semaphore";
2
+ import * as tsplus_module_2 from "@fncts/io/IO/api";
3
+ export const unsafeMakeSemaphore = unsafeMakeSemaphore_1;
4
+ /**
5
+ * @tsplus static fncts.io.SemaphoreOps unsafeMake
6
+ */
7
+ function unsafeMakeSemaphore_1(permits) {
8
+ return new tsplus_module_1.Semaphore(permits);
9
+ }
10
+ /**
11
+ * @tsplus static fncts.io.SemaphoreOps make
12
+ * @tsplus static fncts.io.SemaphoreOps __call
13
+ */
14
+ export function makeSemaphore(permits, __tsplusTrace) {
15
+ return tsplus_module_2.succeed(() => unsafeMakeSemaphore_1(permits), __tsplusTrace);
16
+ }
17
+ //# sourceMappingURL=constructors.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constructors.mjs","names":["unsafeMakeSemaphore","unsafeMakeSemaphore_1","permits","tsplus_module_1","Semaphore","makeSemaphore","__tsplusTrace","tsplus_module_2","succeed"],"sources":["../../_src/Semaphore/constructors.ts"],"sourcesContent":[null],"mappings":";;aAGgBA,mBAAmB,GAAAC,qBAAA;AAHnC;;;AAGA,SAAAA,sBAAoCC,OAAe;EACjD,OAAO,IAAAC,eAAA,CAAIC,SAAS,CAACF,OAAO,CAAC;AAC/B;AAEA;;;;AAIA,OAAM,SAAUG,aAAaA,CAACH,OAAe,EAAEI,aAAsB;EACnE,OAAOC,eAAA,CAAAC,OAAA,OAAGP,qBAAA,CAAqBC,OAAO,CAAC,EADMI,aAAA,CACL;AAC1C","ignoreList":[]}
@@ -0,0 +1,141 @@
1
+ const fileName_1 = "(@fncts/io) src/Semaphore/definition.ts";
2
+ import * as tsplus_module_1 from "@fncts/base/data/Either/constructors";
3
+ import * as tsplus_module_2 from "@fncts/io/Ref/constructors";
4
+ import * as tsplus_module_3 from "@fncts/base/data/Either/destructors";
5
+ import * as tsplus_module_4 from "@fncts/io/IO/api";
6
+ import * as tsplus_module_5 from "@fncts/io/Semaphore/Reservation";
7
+ import * as tsplus_module_6 from "@fncts/base/data/Maybe/constructors";
8
+ import * as tsplus_module_7 from "@fncts/io/Future/api";
9
+ import * as tsplus_module_8 from "@fncts/base/collection/immutable/Queue/api";
10
+ import * as tsplus_module_9 from "@fncts/base/collection/immutable/Queue/constructors";
11
+ import * as tsplus_module_10 from "@fncts/io/Future/constructors";
12
+ import * as tsplus_module_11 from "@fncts/base/data/Maybe/destructors";
13
+ import * as tsplus_module_12 from "@fncts/base/data/Maybe/definition";
14
+ import * as tsplus_module_13 from "@fncts/base/data/Exit/constructors";
15
+ import * as tsplus_module_14 from "@fncts/io/IO/api/bracket";
16
+ import * as tsplus_module_15 from "@fncts/io/IO/api/acquireRelease";
17
+ import { IllegalArgumentError } from "@fncts/base/data/exceptions";
18
+ import { Reservation } from "@fncts/io/Semaphore/Reservation";
19
+ /**
20
+ * @tsplus type fncts.io.Semaphore
21
+ * @tsplus companion fncts.io.SemaphoreOps
22
+ */
23
+ export class Semaphore {
24
+ constructor(permits) {
25
+ this.permits = permits;
26
+ this.ref = tsplus_module_2.unsafeMake(tsplus_module_1.right(this.permits, fileName_1 + ":12:99"), fileName_1 + ":12:23");
27
+ }
28
+ available(__tsplusTrace) {
29
+ return tsplus_module_4.map(_ => tsplus_module_3.match(() => 0, permits => permits)(_), fileName_1 + ":15:28")(this.ref.get);
30
+ }
31
+ tryReserve(n, __tsplusTrace) {
32
+ if (n < 0) {
33
+ return tsplus_module_4.halt(() => new IllegalArgumentError(`Unexpected negative ${n} permits requested`, "Semaphore.tryReserve"), fileName_1 + ":25:21");
34
+ } else if (n === 0) {
35
+ return tsplus_module_4.succeedNow(tsplus_module_6.just(tsplus_module_5.zero, fileName_1 + ":27:32"), fileName_1 + ":27:27");
36
+ } else {
37
+ return this.ref.modify(state => tsplus_module_3.match(() => [tsplus_module_6.nothing(fileName_1 + ":31:25"), state], permits => {
38
+ if (permits >= n) {
39
+ return [tsplus_module_6.just(new Reservation(tsplus_module_4.unit, this.releaseN(n, fileName_1 + ":34:66")), fileName_1 + ":34:27"), tsplus_module_1.right(permits - n, fileName_1 + ":34:85")];
40
+ } else {
41
+ return [tsplus_module_6.nothing(fileName_1 + ":36:30"), state];
42
+ }
43
+ })(state), fileName_1 + ":29:29");
44
+ }
45
+ }
46
+ reserve(n, __tsplusTrace) {
47
+ if (n < 0) {
48
+ return tsplus_module_4.halt(() => new IllegalArgumentError(`Unexpected negative ${n} permits requested`, "Semaphore.reserve"), fileName_1 + ":46:21");
49
+ } else if (n === 0) {
50
+ return tsplus_module_4.succeedNow(tsplus_module_5.zero, fileName_1 + ":48:27");
51
+ } else {
52
+ return tsplus_module_4.flatMap(future => this.ref.modify(state => tsplus_module_3.match(queue => [new Reservation(tsplus_module_7.wait(future, fileName_1 + ":54:37"), this.restore(future, n, fileName_1 + ":54:57")), tsplus_module_1.left(tsplus_module_8.enqueue([future, n])(queue), fileName_1 + ":55:26")], permits => {
53
+ if (permits >= n) {
54
+ return [new Reservation(tsplus_module_4.unit, this.releaseN(n, fileName_1 + ":59:63")), tsplus_module_1.right(permits - n, fileName_1 + ":59:81")];
55
+ } else {
56
+ return [new Reservation(tsplus_module_7.wait(future, fileName_1 + ":62:41"), this.restore(future, n, fileName_1 + ":62:61")), tsplus_module_1.left(tsplus_module_9.single([future, n - permits]), fileName_1 + ":63:30")];
57
+ }
58
+ })(state), fileName_1 + ":51:24"), fileName_1 + ":50:48")(tsplus_module_10.make(fileName_1 + ":50:25"));
59
+ }
60
+ }
61
+ restore(future, n, __tsplusTrace) {
62
+ return tsplus_module_4.flatten(this.ref.modify(state => tsplus_module_3.match(queue => tsplus_module_11.match(() => [this.releaseN(n, fileName_1 + ":80:35"), tsplus_module_1.left(queue, fileName_1 + ":80:51")], ([_, permits]) => [this.releaseN(n - permits, fileName_1 + ":82:30"), tsplus_module_1.left(tsplus_module_8.filter(([waiter]) => waiter !== future)(queue), fileName_1 + ":83:28")])(tsplus_module_8.find(([waiter]) => waiter === future)(queue)), permits => [tsplus_module_4.unit, tsplus_module_1.right(permits + n, fileName_1 + ":86:44")])(state), fileName_1 + ":74:27"), fileName_1 + ":88:6");
63
+ }
64
+ releaseN(n, __tsplusTrace) {
65
+ const self = this;
66
+ /**
67
+ * @tsplus tailRec
68
+ */
69
+ function loop(n, state, acc) {
70
+ var n_1 = n,
71
+ state_1 = state,
72
+ acc_1 = acc;
73
+ var n_2 = n,
74
+ state_2 = state,
75
+ acc_2 = acc;
76
+ while (1) {
77
+ void 0;
78
+ switch (state_1._tag) {
79
+ case "Right" /* EitherTag.Right */:
80
+ {
81
+ return [acc_1, tsplus_module_1.right(state_1.right + n_1, fileName_1 + ":105:36")];
82
+ }
83
+ case "Left" /* EitherTag.Left */:
84
+ {
85
+ const waiter = tsplus_module_8.dequeue(state_1.left);
86
+ void 0;
87
+ switch (waiter._tag) {
88
+ case "Nothing" /* MaybeTag.Nothing */:
89
+ {
90
+ return [acc_1, tsplus_module_1.right(self.permits, fileName_1 + ":114:40")];
91
+ }
92
+ case "Just" /* MaybeTag.Just */:
93
+ {
94
+ const [[future, permits], queue] = waiter.value;
95
+ if (n_1 > permits) {
96
+ n_2 = n_1 - permits;
97
+ state_2 = tsplus_module_1.left(queue, fileName_1 + ":119:53");
98
+ acc_2 = tsplus_module_4.zipLeft(tsplus_module_7.succeed_(undefined, fileName_1 + ":119:88")(future), fileName_1 + ":119:73")(acc_1);
99
+ n_1 = n_2;
100
+ state_1 = state_2;
101
+ acc_1 = acc_2;
102
+ continue;
103
+ } else if (n_1 === permits) {
104
+ return [tsplus_module_4.zipRight(tsplus_module_4.asUnit(tsplus_module_7.succeedVoid_()(future), fileName_1 + ":121:54"), fileName_1 + ":121:37")(acc_1), tsplus_module_1.left(queue, fileName_1 + ":121:75")];
105
+ } else {
106
+ return [acc_1, tsplus_module_1.left(tsplus_module_8.prepend([future, permits - n_1])(queue), fileName_1 + ":123:41")];
107
+ }
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+ return tsplus_module_4.flatten(this.ref.modify(state => loop(n, state, tsplus_module_4.unit), fileName_1 + ":131:27"), fileName_1 + ":131:63");
115
+ }
116
+ tryWithPermits(permits) {
117
+ return (io, __tsPlusTrace) => {
118
+ return tsplus_module_14.bracket(() => this.tryReserve(permits, fileName_1 + ":136:29"), r => tsplus_module_11.match(() => tsplus_module_4.nothing, () => tsplus_module_4.asJust(io, fileName_1 + ":140:21"))(r), r => tsplus_module_11.match(() => tsplus_module_13.unit, reservation => reservation.release)(r), fileName_1 + ":136:46");
119
+ };
120
+ }
121
+ tryWithPermit(io) {
122
+ return this.tryWithPermits(1)(io);
123
+ }
124
+ withPermits(permits) {
125
+ return io => {
126
+ return tsplus_module_14.bracket(() => this.reserve(permits, fileName_1 + ":158:21"), reservation => tsplus_module_4.zipRight(io, fileName_1 + ":159:47")(reservation.acquire), reservation => reservation.release, fileName_1 + ":157:24");
127
+ };
128
+ }
129
+ withPermit(io) {
130
+ return this.withPermits(1)(io);
131
+ }
132
+ withPermitsScoped(permits) {
133
+ return io => {
134
+ return tsplus_module_4.flatMap(reservation => tsplus_module_4.zipRight(io, fileName_1 + ":172:47")(reservation.acquire), fileName_1 + ":171:100")(tsplus_module_15.acquireRelease(() => this.reserve(permits, fileName_1 + ":171:44"), reservation => reservation.release, fileName_1 + ":171:31"));
135
+ };
136
+ }
137
+ withPermitScoped(io) {
138
+ return this.withPermitsScoped(1)(io);
139
+ }
140
+ }
141
+ //# sourceMappingURL=definition.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.mjs","names":["IllegalArgumentError","Reservation","Semaphore","constructor","permits","ref","tsplus_module_2","unsafeMake","tsplus_module_1","right","fileName_1","available","__tsplusTrace","tsplus_module_4","map","_","tsplus_module_3","match","get","tryReserve","n","halt","succeedNow","tsplus_module_6","just","tsplus_module_5","zero","modify","state","nothing","unit","releaseN","reserve","flatMap","future","queue","tsplus_module_7","wait","restore","left","tsplus_module_8","enqueue","tsplus_module_9","single","tsplus_module_10","make","flatten","tsplus_module_11","filter","waiter","find","self","loop","acc","state_1","acc_1","state_2","acc_2","_tag","n_1","dequeue","value","zipLeft","succeed_","undefined","zipRight","asUnit","succeedVoid_","prepend","tryWithPermits","io","__tsPlusTrace","tsplus_module_14","bracket","r","asJust","tsplus_module_13","reservation","release","tryWithPermit","withPermits","acquire","withPermit","withPermitsScoped","tsplus_module_15","acquireRelease","withPermitScoped"],"sources":["../../_src/Semaphore/definition.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AACA,SAASA,oBAAoB,QAAQ,6BAA6B;AAClE,SAASC,WAAW,QAAQ,iCAAiC;AAE7D;;;;AAIA,OAAM,MAAOC,SAAS;EACpBC,YAAqBC,OAAe;IAAf,KAAAA,OAAO,GAAPA,OAAO;IAE5B,KAAAC,GAAG,GAAGC,eAAA,CAAAC,UAAA,CAA8EC,eAAA,CAAAC,KAAA,CAAa,IAAI,CAACL,OAAO,EAAAM,UAAA,YAAC,EAAAA,UAAA,YAAC;EAFxE;EAIvCC,SAASA,CAACC,aAAs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,CAAC5E,OAAe;IACzB,OAAiBkE,EAAe,IAAiB;MAC/C,OAAOE,gBAAA,CAAAC,OAAA,OACL,IAAI,CAACzC,OAAO,CAAC5B,OAAO,EAAAM,UAAA,aAAC,EACpBmE,WAAW,IAAIhE,eAAA,CAAAoD,QAAA,CAAuBK,EAAE,EAAA5D,UAAA,cAAxBmE,WAAW,CAACI,OAAO,CAAK,EACxCJ,WAAW,IAAKA,WAAW,CAACC,OAAO,EAAApE,UAAA,aACrC;IACH,CAAC;EACH;EAEAwE,UAAUA,CAAUZ,EAAe;IACjC,OAAO,IAAI,CAACU,WAAW,CAAC,CAAC,CAAC,CAACV,EAAE,CAAC;EAChC;EAEAa,iBAAiBA,CAAC/E,OAAe;IAC/B,OAAiBkE,EAAe,IAAyB;MACvD,OAAOzD,eAAA,CAAAoB,OAAA,CACJ4C,WAAW,IAAIhE,eAAA,CAAAoD,QAAA,CAAuBK,EAAE,EAAA5D,UAAA,cAAxBmE,WAAW,CAACI,OAAO,CAAK,EAAAvE,UAAA,eADpC0E,gBAAA,CAAAC,cAAA,OAAkB,IAAI,CAACrD,OAAO,CAAC5B,OAAO,EAAAM,UAAA,aAAC,EAAGmE,WAAW,IAAKA,WAAW,CAACC,OAAO,EAAApE,UAAA,aAAC,CAEpF;IACH,CAAC;EACH;EAEA4E,gBAAgBA,CAAUhB,EAAe;IACvC,OAAO,IAAI,CAACa,iBAAiB,CAAC,CAAC,CAAC,CAACb,EAAE,CAAC;EACtC","ignoreList":[]}
@@ -1,134 +1,5 @@
1
- const fileName_1 = "(@fncts/io) src/Semaphore.ts";
2
- import * as tsplus_module_1 from "@fncts/base/data/Either/constructors";
3
- import * as tsplus_module_2 from "@fncts/io/Ref/constructors";
4
- import * as tsplus_module_3 from "@fncts/base/data/Either/destructors";
5
- import * as tsplus_module_4 from "@fncts/io/IO/api";
6
- import * as tsplus_module_5 from "@fncts/io/Future/api";
7
- import * as tsplus_module_6 from "@fncts/base/collection/immutable/Queue/api";
8
- import * as tsplus_module_7 from "@fncts/base/collection/immutable/Queue/constructors";
9
- import * as tsplus_module_8 from "@fncts/io/Future/constructors";
10
- import * as tsplus_module_9 from "@fncts/base/data/Maybe/destructors";
11
- import * as tsplus_module_10 from "@fncts/base/data/Maybe/definition";
12
- import * as tsplus_module_11 from "@fncts/io/IO/api/bracket";
13
- import * as tsplus_module_12 from "@fncts/io/IO/api/acquireRelease";
14
- export const unsafeMakeSemaphore = unsafeMakeSemaphore_1;
15
- import { IllegalArgumentError } from "@fncts/base/data/exceptions";
16
- /**
17
- * @tsplus type fncts.io.Semaphore
18
- * @tsplus companion fncts.io.SemaphoreOps
19
- */
20
- export class Semaphore {
21
- constructor(permits) {
22
- this.permits = permits;
23
- this.ref = tsplus_module_2.unsafeMake(tsplus_module_1.right(this.permits, fileName_1 + ":11:99"), fileName_1 + ":11:23");
24
- }
25
- available(__tsplusTrace) {
26
- return tsplus_module_4.map(_ => tsplus_module_3.match(() => 0, permits => permits)(_), fileName_1 + ":14:28")(this.ref.get);
27
- }
28
- reserve(n, __tsplusTrace) {
29
- if (n < 0) {
30
- return tsplus_module_4.halt(() => new IllegalArgumentError(`Unexpected negative ${n} permits requested`, "Semaphore.reserve"), fileName_1 + ":24:21");
31
- } else if (n === 0) {
32
- return tsplus_module_4.succeedNow(new Reservation(tsplus_module_4.unit, tsplus_module_4.unit), fileName_1 + ":26:27");
33
- } else {
34
- return tsplus_module_4.flatMap(future => this.ref.modify(state => tsplus_module_3.match(queue => [new Reservation(tsplus_module_5.wait(future, fileName_1 + ":32:37"), this.restore(future, n, fileName_1 + ":32:57")), tsplus_module_1.left(tsplus_module_6.enqueue([future, n])(queue), fileName_1 + ":33:26")], permits => {
35
- if (permits >= n) {
36
- return [new Reservation(tsplus_module_4.unit, this.releaseN(n, fileName_1 + ":37:63")), tsplus_module_1.right(permits - n, fileName_1 + ":37:81")];
37
- } else {
38
- return [new Reservation(tsplus_module_5.wait(future, fileName_1 + ":40:41"), this.restore(future, n, fileName_1 + ":40:61")), tsplus_module_1.left(tsplus_module_7.single([future, n - permits]), fileName_1 + ":41:30")];
39
- }
40
- })(state), fileName_1 + ":29:24"), fileName_1 + ":28:48")(tsplus_module_8.make(fileName_1 + ":28:25"));
41
- }
42
- }
43
- restore(future, n, __tsplusTrace) {
44
- return tsplus_module_4.flatten(this.ref.modify(state => tsplus_module_3.match(queue => tsplus_module_9.match(() => [this.releaseN(n, fileName_1 + ":58:35"), tsplus_module_1.left(queue, fileName_1 + ":58:51")], ([_, permits]) => [this.releaseN(n - permits, fileName_1 + ":60:30"), tsplus_module_1.left(tsplus_module_6.filter(([waiter]) => waiter !== future)(queue), fileName_1 + ":61:28")])(tsplus_module_6.find(([waiter]) => waiter === future)(queue)), permits => [tsplus_module_4.unit, tsplus_module_1.right(permits + n, fileName_1 + ":64:44")])(state), fileName_1 + ":52:27"), fileName_1 + ":66:6");
45
- }
46
- releaseN(n, __tsplusTrace) {
47
- const self = this;
48
- /**
49
- * @tsplus tailRec
50
- */
51
- function loop(n, state, acc) {
52
- var n_1 = n,
53
- state_1 = state,
54
- acc_1 = acc;
55
- var n_2 = n,
56
- state_2 = state,
57
- acc_2 = acc;
58
- while (1) {
59
- void 0;
60
- switch (state_1._tag) {
61
- case "Right" /* EitherTag.Right */:
62
- {
63
- return [acc_1, tsplus_module_1.right(state_1.right + n_1, fileName_1 + ":83:36")];
64
- }
65
- case "Left" /* EitherTag.Left */:
66
- {
67
- const waiter = tsplus_module_6.dequeue(state_1.left);
68
- void 0;
69
- switch (waiter._tag) {
70
- case "Nothing" /* MaybeTag.Nothing */:
71
- {
72
- return [acc_1, tsplus_module_1.right(self.permits, fileName_1 + ":92:40")];
73
- }
74
- case "Just" /* MaybeTag.Just */:
75
- {
76
- const [[future, permits], queue] = waiter.value;
77
- if (n_1 > permits) {
78
- n_2 = n_1 - permits;
79
- state_2 = tsplus_module_1.left(queue, fileName_1 + ":97:53");
80
- acc_2 = tsplus_module_4.zipLeft(tsplus_module_5.succeed_(undefined, fileName_1 + ":97:88")(future), fileName_1 + ":97:73")(acc_1);
81
- n_1 = n_2;
82
- state_1 = state_2;
83
- acc_1 = acc_2;
84
- continue;
85
- } else if (n_1 === permits) {
86
- return [tsplus_module_4.zipRight(tsplus_module_4.asUnit(tsplus_module_5.succeedVoid_()(future), fileName_1 + ":99:54"), fileName_1 + ":99:37")(acc_1), tsplus_module_1.left(queue, fileName_1 + ":99:75")];
87
- } else {
88
- return [acc_1, tsplus_module_1.left(tsplus_module_6.prepend([future, permits - n_1])(queue), fileName_1 + ":101:41")];
89
- }
90
- }
91
- }
92
- }
93
- }
94
- }
95
- }
96
- return tsplus_module_4.flatten(this.ref.modify(state => loop(n, state, tsplus_module_4.unit), fileName_1 + ":109:27"), fileName_1 + ":109:63");
97
- }
98
- withPermits(permits) {
99
- return io => {
100
- return tsplus_module_11.bracket(() => this.reserve(permits, fileName_1 + ":115:21"), reservation => tsplus_module_4.zipRight(io, fileName_1 + ":116:47")(reservation.acquire), reservation => reservation.release, fileName_1 + ":114:24");
101
- };
102
- }
103
- withPermit(io) {
104
- return this.withPermits(1)(io);
105
- }
106
- withPermitsScoped(permits) {
107
- return io => {
108
- return tsplus_module_4.flatMap(reservation => tsplus_module_4.zipRight(io, fileName_1 + ":129:47")(reservation.acquire), fileName_1 + ":128:100")(tsplus_module_12.acquireRelease(() => this.reserve(permits, fileName_1 + ":128:44"), reservation => reservation.release, fileName_1 + ":128:31"));
109
- };
110
- }
111
- withPermitScoped(io) {
112
- return this.withPermitsScoped(1)(io);
113
- }
114
- }
115
- export class Reservation {
116
- constructor(acquire, release) {
117
- this.acquire = acquire;
118
- this.release = release;
119
- }
120
- }
121
- /**
122
- * @tsplus static fncts.io.SemaphoreOps unsafeMake
123
- */
124
- function unsafeMakeSemaphore_1(permits) {
125
- return new Semaphore(permits);
126
- }
127
- /**
128
- * @tsplus static fncts.io.SemaphoreOps make
129
- * @tsplus static fncts.io.SemaphoreOps __call
130
- */
131
- export function makeSemaphore(permits, __tsplusTrace) {
132
- return tsplus_module_4.succeed(() => unsafeMakeSemaphore_1(permits), __tsplusTrace);
133
- }
1
+ // codegen:start { preset: barrel, include: ./Semaphore/*.ts }
2
+ export * from "./Semaphore/constructors.mjs";
3
+ export * from "./Semaphore/definition.mjs";
4
+ export * from "./Semaphore/Reservation.mjs";
134
5
  //# sourceMappingURL=Semaphore.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Semaphore.mjs","names":["unsafeMakeSemaphore","unsafeMakeSemaphore_1","IllegalArgumentError","Semaphore","constructor","permits","ref","tsplus_module_2","unsafeMake","tsplus_module_1","right","fileName_1","available","__tsplusTrace","tsplus_module_4","map","_","tsplus_module_3","match","get","reserve","n","halt","succeedNow","Reservation","unit","flatMap","future","modify","state","queue","tsplus_module_5","wait","restore","left","tsplus_module_6","enqueue","releaseN","tsplus_module_7","single","tsplus_module_8","make","flatten","tsplus_module_9","filter","waiter","find","self","loop","acc","state_1","acc_1","state_2","acc_2","_tag","n_1","dequeue","value","zipLeft","succeed_","undefined","zipRight","asUnit","succeedVoid_","prepend","withPermits","io","tsplus_module_11","bracket","reservation","acquire","release","withPermit","withPermitsScoped","tsplus_module_12","acquireRelease","withPermitScoped","makeSemaphore","succeed"],"sources":["../_src/Semaphore.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;aAoJgBA,mBAAmB,GAAAC,qBAAA;AAnJnC,SAASC,oBAAoB,QAAQ,6BAA6B;AAElE;;;;AAIA,OAAM,MAAOC,SAAS;EACpBC,YAAqBC,OAAe;IAAf,KAAAA,OAAO,GAAPA,OAAO;IAE5B,KAAAC,GAAG,GAAGC,eAAA,CAAAC,UAAA,CAA8EC,eAAA,CAAAC,KAAA,CAAa,IAAI,CAACL,OAAO,EAAAM,UAAA,YAAC,EAAAA,UAAA,YAAC;EAFxE;EAIvCC,SAASA,CAACC,aAAsB;IAC9B,OAAOC,eAAA,CAAAC,GAAA,CAAkBC,CAAC,IACxBC,eAAA,CAAAC,KAAA,CACE,MAAM,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OAAiB6D,EAAe,IAAyB;MACvD,OAAOpD,eAAA,CAAAY,OAAA,CACJ2C,WAAW,IAAIvD,eAAA,CAAA+C,QAAA,CAAuBK,EAAE,EAAAvD,UAAA,cAAxB0D,WAAW,CAACC,OAAO,CAAK,EAAA3D,UAAA,eADpC+D,gBAAA,CAAAC,cAAA,OAAkB,IAAI,CAACvD,OAAO,CAACf,OAAO,EAAAM,UAAA,aAAC,EAAG0D,WAAW,IAAKA,WAAW,CAACE,OAAO,EAAA5D,UAAA,aAAC,CAEpF;IACH,CAAC;EACH;EAEAiE,gBAAgBA,CAAUV,EAAe;IACvC,OAAO,IAAI,CAACO,iBAAiB,CAAC,CAAC,CAAC,CAACP,EAAE,CAAC;EACtC;;AAGF,OAAM,MAAO1C,WAAW;EACtBpB,YACWkE,OAAkB,EAClBC,OAAkB;IADlB,KAAAD,OAAO,GAAPA,OAAO;IACP,KAAAC,OAAO,GAAPA,OAAO;EACf;;AAGL;;;AAGA,SAAAtE,sBAAoCI,OAAe;EACjD,OAAO,IAAIF,SAAS,CAACE,OAAO,CAAC;AAC/B;AAEA;;;;AAIA,OAAM,SAAUwE,aAAaA,CAACxE,OAAe,EAAEQ,aAAsB;EACnE,OAAOC,eAAA,CAAAgE,OAAA,OAAG7E,qBAAA,CAAqBI,OAAO,CAAC,EADMQ,aAAA,CACL;AAC1C","ignoreList":[]}
1
+ {"version":3,"file":"Semaphore.mjs","names":[],"sources":["../_src/Semaphore.ts"],"sourcesContent":[null],"mappings":"AAAA;AACA,cAAc,8BAA6B;AAC3C,cAAc,4BAA2B;AACzC,cAAc,6BAA4B","ignoreList":[]}
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * Sink is a data type that represent a channel that reads elements
3
- * of type `In`, handles input errors of type `InErr`, emits errors
4
- * of type `OutErr`, emits outputs of type `L` and ends with a value
5
- * of type `Z`.
3
+ * of type `In`, emits errors of type `OutErr`, emits outputs of type `Out` and ends with a value
4
+ * of type `Done`.
6
5
  *
7
6
  * @tsplus type fncts.io.Sink
8
7
  * @tsplus companion fncts.io.SinkOps
@@ -1 +1 @@
1
- {"version":3,"file":"definition.mjs","names":["Sink","constructor","channel"],"sources":["../../_src/Sink/definition.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;AASA,OAAM,MAAOA,IAAI;EACfC,YAAqBC,OAA4D;IAA5D,KAAAA,OAAO,GAAPA,OAAO;EAAwD","ignoreList":[]}
1
+ {"version":3,"file":"definition.mjs","names":["Sink","constructor","channel"],"sources":["../../_src/Sink/definition.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;AAQA,OAAM,MAAOA,IAAI;EACfC,YAAqBC,OAAwE;IAAxE,KAAAA,OAAO,GAAPA,OAAO;EAAoE","ignoreList":[]}