@fncts/io 0.0.21 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1604) hide show
  1. package/Cached/definition.d.ts +6 -4
  2. package/Cached/internal.d.ts +4 -4
  3. package/Channel/api/mapOutConcurrentIO.d.ts +8 -0
  4. package/Channel/api/zipConcurrent.d.ts +16 -0
  5. package/Channel/api.d.ts +9 -9
  6. package/Channel/core-api.d.ts +4 -4
  7. package/Channel/definition.d.ts +35 -14
  8. package/Channel/internal/ChannelExecutor.d.ts +1 -0
  9. package/Channel/internal/MergeDecision.d.ts +10 -6
  10. package/Channel/internal/SingleProducerAsyncInput.d.ts +1 -1
  11. package/CountdownLatch.d.ts +25 -0
  12. package/Differ/definition.d.ts +2 -4
  13. package/Fiber/FiberMessage.d.ts +67 -0
  14. package/Fiber/FiberRuntime.d.ts +114 -0
  15. package/Fiber/api/interrupt.d.ts +1 -1
  16. package/Fiber/api/interruptAs.d.ts +8 -3
  17. package/Fiber/api/location.d.ts +1 -2
  18. package/Fiber/definition.d.ts +29 -22
  19. package/Fiber.d.ts +2 -4
  20. package/FiberDescriptor.d.ts +3 -6
  21. package/FiberRef/definition.d.ts +8 -4
  22. package/FiberRef/unsafe.d.ts +5 -0
  23. package/FiberRefs/api.d.ts +28 -0
  24. package/FiberRefs/definition.d.ts +14 -7
  25. package/FiberScope/constructors.d.ts +2 -2
  26. package/FiberScope/definition.d.ts +8 -5
  27. package/FiberStatus/constructors.d.ts +3 -7
  28. package/FiberStatus/definition.d.ts +16 -28
  29. package/Hub/api.d.ts +192 -0
  30. package/Hub/definition.d.ts +97 -35
  31. package/Hub/internal.d.ts +11 -4
  32. package/Hub.d.ts +1 -1
  33. package/IO/api/asyncInterrupt.d.ts +39 -0
  34. package/IO/api/core-scope.d.ts +6 -42
  35. package/IO/api/delay.d.ts +8 -0
  36. package/IO/api/{foreachC.d.ts → foreachConcurrent.d.ts} +8 -8
  37. package/IO/api/fork.d.ts +36 -0
  38. package/IO/api/interrupt.d.ts +23 -27
  39. package/IO/api/onTermination.d.ts +0 -1
  40. package/IO/api/race.d.ts +1 -1
  41. package/IO/api/sequenceT.d.ts +19 -3
  42. package/IO/api/supervised.d.ts +4 -6
  43. package/IO/api/zipConcurrent.d.ts +13 -0
  44. package/IO/api.d.ts +45 -130
  45. package/IO/definition.d.ts +137 -148
  46. package/IO/runtime.d.ts +19 -22
  47. package/IO.d.ts +5 -4
  48. package/Layer/MemoMap.d.ts +1 -1
  49. package/Layer/definition.d.ts +17 -13
  50. package/Logger/definition.d.ts +10 -6
  51. package/MVar/api.d.ts +101 -0
  52. package/MVar/definition.d.ts +43 -0
  53. package/MVar.d.ts +2 -0
  54. package/Push/api.d.ts +235 -0
  55. package/Push/definition.d.ts +41 -0
  56. package/Push/internal.d.ts +11 -0
  57. package/Push.d.ts +3 -0
  58. package/Queue/api/dimapIO.d.ts +102 -0
  59. package/Queue/api/filterInputIO.d.ts +25 -0
  60. package/Queue/api/filterOutputIO.d.ts +20 -0
  61. package/Queue/api/operations.d.ts +83 -0
  62. package/Queue/api/poll.d.ts +9 -0
  63. package/Queue/api/takeBetween.d.ts +11 -0
  64. package/Queue/api/zipWithIO.d.ts +27 -0
  65. package/Queue/api.d.ts +7 -0
  66. package/Queue/constructors.d.ts +1 -2
  67. package/Queue/definition.d.ts +178 -75
  68. package/Queue/internal.d.ts +4 -2
  69. package/Queue.d.ts +2 -0
  70. package/Ref/Atomic.d.ts +15 -8
  71. package/Ref/Derived.d.ts +18 -0
  72. package/Ref/DerivedAll.d.ts +18 -0
  73. package/Ref/Synchronized/api.d.ts +102 -0
  74. package/Ref/Synchronized/constructors.d.ts +13 -0
  75. package/Ref/Synchronized/definition.d.ts +46 -0
  76. package/Ref/Synchronized.d.ts +3 -72
  77. package/Ref/api/collect.d.ts +11 -0
  78. package/Ref/api/dimap.d.ts +56 -0
  79. package/Ref/api/filter.d.ts +21 -0
  80. package/Ref/api/get.d.ts +9 -0
  81. package/Ref/api/match.d.ts +13 -0
  82. package/Ref/api/matchAll.d.ts +11 -0
  83. package/Ref/api/modify.d.ts +79 -0
  84. package/Ref/api/set.d.ts +10 -0
  85. package/Ref/api.d.ts +23 -0
  86. package/Ref/constructors.d.ts +1 -8
  87. package/Ref/definition.d.ts +90 -55
  88. package/Ref.d.ts +6 -0
  89. package/RefSubject/Atomic.d.ts +36 -0
  90. package/RefSubject/Synchronized/api.d.ts +9 -0
  91. package/RefSubject/Synchronized/definition.d.ts +40 -0
  92. package/RefSubject/api.d.ts +116 -0
  93. package/RefSubject/definition.d.ts +51 -0
  94. package/RefSubject.d.ts +3 -0
  95. package/Reloadable/definition.d.ts +5 -1
  96. package/RuntimeConfig.d.ts +0 -24
  97. package/RuntimeFlag.d.ts +10 -0
  98. package/RuntimeFlags/Patch.d.ts +53 -0
  99. package/RuntimeFlags/RuntimeFlags.d.ts +82 -0
  100. package/RuntimeFlags.d.ts +2 -0
  101. package/STM/api/atomically.d.ts +9 -0
  102. package/STM/api.d.ts +12 -6
  103. package/STM/definition.d.ts +28 -15
  104. package/STM/internal/Entry.d.ts +2 -2
  105. package/STM/internal/TryCommit.d.ts +2 -2
  106. package/STM/internal/Versioned.d.ts +1 -1
  107. package/STM.d.ts +1 -0
  108. package/Schedule/api.d.ts +33 -17
  109. package/Schedule/definition.d.ts +7 -3
  110. package/Scope/ReleaseMap/definition.d.ts +1 -1
  111. package/Scope/definition.d.ts +1 -1
  112. package/ScopedRef/api.d.ts +1 -1
  113. package/ScopedRef/definition.d.ts +1 -1
  114. package/Sink/api.d.ts +12 -12
  115. package/State/api.d.ts +1 -1
  116. package/State/definition.d.ts +5 -2
  117. package/State/internal.d.ts +6 -2
  118. package/Stream/api.d.ts +20 -19
  119. package/Stream/definition.d.ts +26 -5
  120. package/Stream/internal/Handoff.d.ts +22 -16
  121. package/Stream/internal/Pull.d.ts +2 -2
  122. package/Stream/internal/SinkEndReason.d.ts +2 -2
  123. package/Subject/Atomic.d.ts +22 -0
  124. package/Subject/api.d.ts +13 -0
  125. package/Subject/definition.d.ts +15 -0
  126. package/Subject.d.ts +3 -0
  127. package/SubscriptionRef.d.ts +16 -7
  128. package/SupervisorPatch.d.ts +1 -1
  129. package/TExit/definition.d.ts +7 -7
  130. package/TFuture/definition.d.ts +2 -2
  131. package/TReentrantLock/definition.d.ts +3 -3
  132. package/TRef/api.d.ts +14 -15
  133. package/TRef/constructors.d.ts +6 -6
  134. package/TRef/definition.d.ts +54 -39
  135. package/TSemaphore/definition.d.ts +2 -2
  136. package/_cjs/Cached/api.cjs +1 -24
  137. package/_cjs/Cached/api.cjs.map +1 -1
  138. package/_cjs/Cached/definition.cjs +6 -9
  139. package/_cjs/Cached/definition.cjs.map +1 -1
  140. package/_cjs/Cached/internal.cjs +7 -9
  141. package/_cjs/Cached/internal.cjs.map +1 -1
  142. package/_cjs/Cached.cjs +0 -6
  143. package/_cjs/Cached.cjs.map +1 -1
  144. package/_cjs/CancellerState.cjs +3 -22
  145. package/_cjs/CancellerState.cjs.map +1 -1
  146. package/_cjs/Channel/ChildExecutorDecision/api.cjs +0 -3
  147. package/_cjs/Channel/ChildExecutorDecision/api.cjs.map +1 -1
  148. package/_cjs/Channel/ChildExecutorDecision/definition.cjs +0 -5
  149. package/_cjs/Channel/ChildExecutorDecision/definition.cjs.map +1 -1
  150. package/_cjs/Channel/ChildExecutorDecision.cjs +0 -4
  151. package/_cjs/Channel/ChildExecutorDecision.cjs.map +1 -1
  152. package/_cjs/Channel/UpstreamPullRequest/api.cjs +0 -7
  153. package/_cjs/Channel/UpstreamPullRequest/api.cjs.map +1 -1
  154. package/_cjs/Channel/UpstreamPullRequest/definition.cjs +0 -6
  155. package/_cjs/Channel/UpstreamPullRequest/definition.cjs.map +1 -1
  156. package/_cjs/Channel/UpstreamPullRequest.cjs +0 -4
  157. package/_cjs/Channel/UpstreamPullRequest.cjs.map +1 -1
  158. package/_cjs/Channel/UpstreamPullStrategy/definition.cjs +0 -4
  159. package/_cjs/Channel/UpstreamPullStrategy/definition.cjs.map +1 -1
  160. package/_cjs/Channel/UpstreamPullStrategy.cjs +0 -2
  161. package/_cjs/Channel/UpstreamPullStrategy.cjs.map +1 -1
  162. package/_cjs/Channel/api/interruptWhen.cjs +0 -12
  163. package/_cjs/Channel/api/interruptWhen.cjs.map +1 -1
  164. package/_cjs/Channel/api/mapOutConcurrentIO.cjs +42 -0
  165. package/_cjs/Channel/api/mapOutConcurrentIO.cjs.map +1 -0
  166. package/_cjs/Channel/api/mergeAll.cjs +0 -4
  167. package/_cjs/Channel/api/mergeAll.cjs.map +1 -1
  168. package/_cjs/Channel/api/mergeAllUnboundedWith.cjs +0 -4
  169. package/_cjs/Channel/api/mergeAllUnboundedWith.cjs.map +1 -1
  170. package/_cjs/Channel/api/mergeAllWith.cjs +39 -66
  171. package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
  172. package/_cjs/Channel/api/mergeMap.cjs +0 -5
  173. package/_cjs/Channel/api/mergeMap.cjs.map +1 -1
  174. package/_cjs/Channel/api/mergeWith.cjs +10 -44
  175. package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
  176. package/_cjs/Channel/api/run.cjs +0 -6
  177. package/_cjs/Channel/api/run.cjs.map +1 -1
  178. package/_cjs/Channel/api/runCollect.cjs +0 -5
  179. package/_cjs/Channel/api/runCollect.cjs.map +1 -1
  180. package/_cjs/Channel/api/runDrain.cjs +0 -5
  181. package/_cjs/Channel/api/runDrain.cjs.map +1 -1
  182. package/_cjs/Channel/api/runScoped.cjs +4 -26
  183. package/_cjs/Channel/api/runScoped.cjs.map +1 -1
  184. package/_cjs/Channel/api/toPull.cjs +4 -26
  185. package/_cjs/Channel/api/toPull.cjs.map +1 -1
  186. package/_cjs/Channel/api/{zipC.cjs → zipConcurrent.cjs} +16 -30
  187. package/_cjs/Channel/api/zipConcurrent.cjs.map +1 -0
  188. package/_cjs/Channel/api.cjs +85 -256
  189. package/_cjs/Channel/api.cjs.map +1 -1
  190. package/_cjs/Channel/core-api.cjs +6 -30
  191. package/_cjs/Channel/core-api.cjs.map +1 -1
  192. package/_cjs/Channel/definition.cjs +32 -108
  193. package/_cjs/Channel/definition.cjs.map +1 -1
  194. package/_cjs/Channel/internal/ChannelExecutor.cjs +117 -322
  195. package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
  196. package/_cjs/Channel/internal/ChannelState.cjs +5 -37
  197. package/_cjs/Channel/internal/ChannelState.cjs.map +1 -1
  198. package/_cjs/Channel/internal/MergeDecision.cjs +11 -30
  199. package/_cjs/Channel/internal/MergeDecision.cjs.map +1 -1
  200. package/_cjs/Channel/internal/MergeState.cjs +3 -24
  201. package/_cjs/Channel/internal/MergeState.cjs.map +1 -1
  202. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +41 -133
  203. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
  204. package/_cjs/Channel.cjs +0 -6
  205. package/_cjs/Channel.cjs.map +1 -1
  206. package/_cjs/Clock/api.cjs +0 -7
  207. package/_cjs/Clock/api.cjs.map +1 -1
  208. package/_cjs/Clock/definition.cjs +0 -6
  209. package/_cjs/Clock/definition.cjs.map +1 -1
  210. package/_cjs/Clock/live.cjs +2 -12
  211. package/_cjs/Clock/live.cjs.map +1 -1
  212. package/_cjs/Clock.cjs +0 -6
  213. package/_cjs/Clock.cjs.map +1 -1
  214. package/_cjs/Console/api.cjs +0 -7
  215. package/_cjs/Console/api.cjs.map +1 -1
  216. package/_cjs/Console/definition.cjs +0 -6
  217. package/_cjs/Console/definition.cjs.map +1 -1
  218. package/_cjs/Console/live.cjs +0 -11
  219. package/_cjs/Console/live.cjs.map +1 -1
  220. package/_cjs/Console.cjs +0 -6
  221. package/_cjs/Console.cjs.map +1 -1
  222. package/_cjs/CountdownLatch.cjs +52 -0
  223. package/_cjs/CountdownLatch.cjs.map +1 -0
  224. package/_cjs/Differ/api.cjs +0 -23
  225. package/_cjs/Differ/api.cjs.map +1 -1
  226. package/_cjs/Differ/definition.cjs +3 -5
  227. package/_cjs/Differ/definition.cjs.map +1 -1
  228. package/_cjs/Fiber/FiberMessage.cjs +72 -0
  229. package/_cjs/Fiber/FiberMessage.cjs.map +1 -0
  230. package/_cjs/Fiber/FiberRuntime.cjs +742 -0
  231. package/_cjs/Fiber/FiberRuntime.cjs.map +1 -0
  232. package/_cjs/Fiber/api/await.cjs +0 -1
  233. package/_cjs/Fiber/api/await.cjs.map +1 -1
  234. package/_cjs/Fiber/api/awaitAll.cjs +2 -8
  235. package/_cjs/Fiber/api/awaitAll.cjs.map +1 -1
  236. package/_cjs/Fiber/api/children.cjs +0 -1
  237. package/_cjs/Fiber/api/children.cjs.map +1 -1
  238. package/_cjs/Fiber/api/collectAll.cjs +3 -25
  239. package/_cjs/Fiber/api/collectAll.cjs.map +1 -1
  240. package/_cjs/Fiber/api/fromIO.cjs +0 -5
  241. package/_cjs/Fiber/api/fromIO.cjs.map +1 -1
  242. package/_cjs/Fiber/api/id.cjs +0 -1
  243. package/_cjs/Fiber/api/id.cjs.map +1 -1
  244. package/_cjs/Fiber/api/inheritRefs.cjs +1 -2
  245. package/_cjs/Fiber/api/inheritRefs.cjs.map +1 -1
  246. package/_cjs/Fiber/api/interrupt.cjs +3 -8
  247. package/_cjs/Fiber/api/interrupt.cjs.map +1 -1
  248. package/_cjs/Fiber/api/interruptAll.cjs +2 -12
  249. package/_cjs/Fiber/api/interruptAll.cjs.map +1 -1
  250. package/_cjs/Fiber/api/interruptAs.cjs +16 -11
  251. package/_cjs/Fiber/api/interruptAs.cjs.map +1 -1
  252. package/_cjs/Fiber/api/interruptFork.cjs +2 -9
  253. package/_cjs/Fiber/api/interruptFork.cjs.map +1 -1
  254. package/_cjs/Fiber/api/join.cjs +3 -6
  255. package/_cjs/Fiber/api/join.cjs.map +1 -1
  256. package/_cjs/Fiber/api/joinAll.cjs +0 -6
  257. package/_cjs/Fiber/api/joinAll.cjs.map +1 -1
  258. package/_cjs/Fiber/api/location.cjs +1 -8
  259. package/_cjs/Fiber/api/location.cjs.map +1 -1
  260. package/_cjs/Fiber/api/mapFiber.cjs +0 -7
  261. package/_cjs/Fiber/api/mapFiber.cjs.map +1 -1
  262. package/_cjs/Fiber/api/mapIO.cjs +1 -18
  263. package/_cjs/Fiber/api/mapIO.cjs.map +1 -1
  264. package/_cjs/Fiber/api/poll.cjs +0 -1
  265. package/_cjs/Fiber/api/poll.cjs.map +1 -1
  266. package/_cjs/Fiber/api/zipWith.cjs +2 -18
  267. package/_cjs/Fiber/api/zipWith.cjs.map +1 -1
  268. package/_cjs/Fiber/constructors.cjs +0 -18
  269. package/_cjs/Fiber/constructors.cjs.map +1 -1
  270. package/_cjs/Fiber/definition.cjs +18 -17
  271. package/_cjs/Fiber/definition.cjs.map +1 -1
  272. package/_cjs/Fiber.cjs +15 -85
  273. package/_cjs/Fiber.cjs.map +1 -1
  274. package/_cjs/FiberDescriptor.cjs +1 -6
  275. package/_cjs/FiberDescriptor.cjs.map +1 -1
  276. package/_cjs/FiberRef/api/locallyScoped.cjs +0 -6
  277. package/_cjs/FiberRef/api/locallyScoped.cjs.map +1 -1
  278. package/_cjs/FiberRef/api/locallyScopedWith.cjs +0 -5
  279. package/_cjs/FiberRef/api/locallyScopedWith.cjs.map +1 -1
  280. package/_cjs/FiberRef/api.cjs +18 -54
  281. package/_cjs/FiberRef/api.cjs.map +1 -1
  282. package/_cjs/FiberRef/constructors.cjs +0 -10
  283. package/_cjs/FiberRef/constructors.cjs.map +1 -1
  284. package/_cjs/FiberRef/definition.cjs +13 -27
  285. package/_cjs/FiberRef/definition.cjs.map +1 -1
  286. package/_cjs/FiberRef/unsafe.cjs +20 -48
  287. package/_cjs/FiberRef/unsafe.cjs.map +1 -1
  288. package/_cjs/FiberRef.cjs +0 -12
  289. package/_cjs/FiberRef.cjs.map +1 -1
  290. package/_cjs/FiberRefs/api.cjs +62 -22
  291. package/_cjs/FiberRefs/api.cjs.map +1 -1
  292. package/_cjs/FiberRefs/definition.cjs +5 -17
  293. package/_cjs/FiberRefs/definition.cjs.map +1 -1
  294. package/_cjs/FiberRefs/join.cjs +34 -56
  295. package/_cjs/FiberRefs/join.cjs.map +1 -1
  296. package/_cjs/FiberRefs.cjs +0 -6
  297. package/_cjs/FiberRefs.cjs.map +1 -1
  298. package/_cjs/FiberScope/constructors.cjs +0 -4
  299. package/_cjs/FiberScope/constructors.cjs.map +1 -1
  300. package/_cjs/FiberScope/definition.cjs +15 -20
  301. package/_cjs/FiberScope/definition.cjs.map +1 -1
  302. package/_cjs/FiberScope.cjs +0 -4
  303. package/_cjs/FiberScope.cjs.map +1 -1
  304. package/_cjs/FiberStatus/constructors.cjs +5 -20
  305. package/_cjs/FiberStatus/constructors.cjs.map +1 -1
  306. package/_cjs/FiberStatus/definition.cjs +18 -77
  307. package/_cjs/FiberStatus/definition.cjs.map +1 -1
  308. package/_cjs/FiberStatus.cjs +0 -4
  309. package/_cjs/FiberStatus.cjs.map +1 -1
  310. package/_cjs/Future/api.cjs +28 -77
  311. package/_cjs/Future/api.cjs.map +1 -1
  312. package/_cjs/Future/constructors.cjs +0 -11
  313. package/_cjs/Future/constructors.cjs.map +1 -1
  314. package/_cjs/Future/definition.cjs +2 -15
  315. package/_cjs/Future/definition.cjs.map +1 -1
  316. package/_cjs/Future.cjs +0 -6
  317. package/_cjs/Future.cjs.map +1 -1
  318. package/_cjs/Hub/api.cjs +396 -0
  319. package/_cjs/Hub/api.cjs.map +1 -0
  320. package/_cjs/Hub/definition.cjs +22 -104
  321. package/_cjs/Hub/definition.cjs.map +1 -1
  322. package/_cjs/Hub/internal.cjs +103 -170
  323. package/_cjs/Hub/internal.cjs.map +1 -1
  324. package/_cjs/Hub.cjs +4 -8
  325. package/_cjs/Hub.cjs.map +1 -1
  326. package/_cjs/IO/api/acquireRelease.cjs +0 -4
  327. package/_cjs/IO/api/acquireRelease.cjs.map +1 -1
  328. package/_cjs/IO/api/acquireReleaseExit.cjs +0 -6
  329. package/_cjs/IO/api/acquireReleaseExit.cjs.map +1 -1
  330. package/_cjs/IO/api/acquireReleaseInterruptible.cjs +0 -4
  331. package/_cjs/IO/api/acquireReleaseInterruptible.cjs.map +1 -1
  332. package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs +2 -6
  333. package/_cjs/IO/api/acquireReleaseInterruptibleExit.cjs.map +1 -1
  334. package/_cjs/IO/api/addFinalizer.cjs +0 -4
  335. package/_cjs/IO/api/addFinalizer.cjs.map +1 -1
  336. package/_cjs/IO/api/addFinalizerExit.cjs +0 -7
  337. package/_cjs/IO/api/addFinalizerExit.cjs.map +1 -1
  338. package/_cjs/IO/api/asyncIO.cjs +7 -15
  339. package/_cjs/IO/api/asyncIO.cjs.map +1 -1
  340. package/_cjs/IO/api/asyncInterrupt.cjs +77 -0
  341. package/_cjs/IO/api/asyncInterrupt.cjs.map +1 -0
  342. package/_cjs/IO/api/bracket.cjs +0 -4
  343. package/_cjs/IO/api/bracket.cjs.map +1 -1
  344. package/_cjs/IO/api/bracketExit.cjs +1 -8
  345. package/_cjs/IO/api/bracketExit.cjs.map +1 -1
  346. package/_cjs/IO/api/clockWith.cjs +0 -12
  347. package/_cjs/IO/api/clockWith.cjs.map +1 -1
  348. package/_cjs/IO/api/concurrency.cjs +0 -15
  349. package/_cjs/IO/api/concurrency.cjs.map +1 -1
  350. package/_cjs/IO/api/concurrentFinalizers.cjs +0 -7
  351. package/_cjs/IO/api/concurrentFinalizers.cjs.map +1 -1
  352. package/_cjs/IO/api/consoleWith.cjs +0 -12
  353. package/_cjs/IO/api/consoleWith.cjs.map +1 -1
  354. package/_cjs/IO/api/core-scope.cjs +49 -119
  355. package/_cjs/IO/api/core-scope.cjs.map +1 -1
  356. package/_cjs/IO/api/{onExit.cjs → delay.cjs} +8 -12
  357. package/_cjs/IO/api/delay.cjs.map +1 -0
  358. package/_cjs/IO/api/ensuringChildren.cjs +3 -8
  359. package/_cjs/IO/api/ensuringChildren.cjs.map +1 -1
  360. package/_cjs/IO/api/environment.cjs +0 -29
  361. package/_cjs/IO/api/environment.cjs.map +1 -1
  362. package/_cjs/IO/api/{foreachC.cjs → foreachConcurrent.cjs} +32 -65
  363. package/_cjs/IO/api/foreachConcurrent.cjs.map +1 -0
  364. package/_cjs/IO/api/foreachExec.cjs +2 -9
  365. package/_cjs/IO/api/foreachExec.cjs.map +1 -1
  366. package/_cjs/IO/api/fork.cjs +75 -0
  367. package/_cjs/IO/api/fork.cjs.map +1 -0
  368. package/_cjs/IO/api/forkAll.cjs +3 -7
  369. package/_cjs/IO/api/forkAll.cjs.map +1 -1
  370. package/_cjs/IO/api/forkIn.cjs +1 -9
  371. package/_cjs/IO/api/forkIn.cjs.map +1 -1
  372. package/_cjs/IO/api/forkScoped.cjs +1 -9
  373. package/_cjs/IO/api/forkScoped.cjs.map +1 -1
  374. package/_cjs/IO/api/fulfill.cjs +1 -7
  375. package/_cjs/IO/api/fulfill.cjs.map +1 -1
  376. package/_cjs/IO/api/interrupt.cjs +78 -101
  377. package/_cjs/IO/api/interrupt.cjs.map +1 -1
  378. package/_cjs/IO/api/memoize.cjs +1 -8
  379. package/_cjs/IO/api/memoize.cjs.map +1 -1
  380. package/_cjs/IO/api/onTermination.cjs +7 -14
  381. package/_cjs/IO/api/onTermination.cjs.map +1 -1
  382. package/_cjs/IO/api/once.cjs +4 -8
  383. package/_cjs/IO/api/once.cjs.map +1 -1
  384. package/_cjs/IO/api/provideLayer.cjs +0 -8
  385. package/_cjs/IO/api/provideLayer.cjs.map +1 -1
  386. package/_cjs/IO/api/provideSomeLayer.cjs +0 -5
  387. package/_cjs/IO/api/provideSomeLayer.cjs.map +1 -1
  388. package/_cjs/IO/api/race.cjs +4 -15
  389. package/_cjs/IO/api/race.cjs.map +1 -1
  390. package/_cjs/IO/api/raceFirst.cjs +1 -6
  391. package/_cjs/IO/api/raceFirst.cjs.map +1 -1
  392. package/_cjs/IO/api/randomWith.cjs +0 -12
  393. package/_cjs/IO/api/randomWith.cjs.map +1 -1
  394. package/_cjs/IO/api/repeat.cjs +0 -15
  395. package/_cjs/IO/api/repeat.cjs.map +1 -1
  396. package/_cjs/IO/api/retry.cjs +0 -15
  397. package/_cjs/IO/api/retry.cjs.map +1 -1
  398. package/_cjs/IO/api/schedule.cjs +0 -10
  399. package/_cjs/IO/api/schedule.cjs.map +1 -1
  400. package/_cjs/IO/api/scope.cjs +0 -6
  401. package/_cjs/IO/api/scope.cjs.map +1 -1
  402. package/_cjs/IO/api/scopeWith.cjs +0 -5
  403. package/_cjs/IO/api/scopeWith.cjs.map +1 -1
  404. package/_cjs/IO/api/scoped.cjs +0 -9
  405. package/_cjs/IO/api/scoped.cjs.map +1 -1
  406. package/_cjs/IO/api/sequenceT.cjs +1 -7
  407. package/_cjs/IO/api/sequenceT.cjs.map +1 -1
  408. package/_cjs/IO/api/sleep.cjs +0 -4
  409. package/_cjs/IO/api/sleep.cjs.map +1 -1
  410. package/_cjs/IO/api/stateful.cjs +0 -6
  411. package/_cjs/IO/api/stateful.cjs.map +1 -1
  412. package/_cjs/IO/api/supervised.cjs +6 -16
  413. package/_cjs/IO/api/supervised.cjs.map +1 -1
  414. package/_cjs/IO/api/timeout.cjs +0 -12
  415. package/_cjs/IO/api/timeout.cjs.map +1 -1
  416. package/_cjs/IO/api/withChildren.cjs +2 -10
  417. package/_cjs/IO/api/withChildren.cjs.map +1 -1
  418. package/_cjs/IO/api/withEarlyRelease.cjs +0 -7
  419. package/_cjs/IO/api/withEarlyRelease.cjs.map +1 -1
  420. package/_cjs/IO/api/withFinalizer.cjs +0 -4
  421. package/_cjs/IO/api/withFinalizer.cjs.map +1 -1
  422. package/_cjs/IO/api/withFinalizerExit.cjs +0 -4
  423. package/_cjs/IO/api/withFinalizerExit.cjs.map +1 -1
  424. package/_cjs/IO/api/{zipC.cjs → zipConcurrent.cjs} +21 -41
  425. package/_cjs/IO/api/zipConcurrent.cjs.map +1 -0
  426. package/_cjs/IO/api.cjs +180 -667
  427. package/_cjs/IO/api.cjs.map +1 -1
  428. package/_cjs/IO/definition.cjs +131 -218
  429. package/_cjs/IO/definition.cjs.map +1 -1
  430. package/_cjs/IO/runtime.cjs +51 -119
  431. package/_cjs/IO/runtime.cjs.map +1 -1
  432. package/_cjs/IO.cjs +41 -134
  433. package/_cjs/IO.cjs.map +1 -1
  434. package/_cjs/IOEnv/definition.cjs +0 -11
  435. package/_cjs/IOEnv/definition.cjs.map +1 -1
  436. package/_cjs/IOEnv/live.cjs +0 -11
  437. package/_cjs/IOEnv/live.cjs.map +1 -1
  438. package/_cjs/IOEnv/services.cjs +0 -5
  439. package/_cjs/IOEnv/services.cjs.map +1 -1
  440. package/_cjs/IOEnv.cjs +0 -6
  441. package/_cjs/IOEnv.cjs.map +1 -1
  442. package/_cjs/InterruptStatus/constructors.cjs +0 -5
  443. package/_cjs/InterruptStatus/constructors.cjs.map +1 -1
  444. package/_cjs/InterruptStatus/definition.cjs +0 -5
  445. package/_cjs/InterruptStatus/definition.cjs.map +1 -1
  446. package/_cjs/InterruptStatus.cjs +0 -4
  447. package/_cjs/InterruptStatus.cjs.map +1 -1
  448. package/_cjs/Layer/MemoMap.cjs +40 -92
  449. package/_cjs/Layer/MemoMap.cjs.map +1 -1
  450. package/_cjs/Layer/api.cjs +5 -106
  451. package/_cjs/Layer/api.cjs.map +1 -1
  452. package/_cjs/Layer/definition.cjs +14 -54
  453. package/_cjs/Layer/definition.cjs.map +1 -1
  454. package/_cjs/Layer.cjs +0 -6
  455. package/_cjs/Layer.cjs.map +1 -1
  456. package/_cjs/LogLevel.cjs +0 -20
  457. package/_cjs/LogLevel.cjs.map +1 -1
  458. package/_cjs/LogSpan.cjs +0 -7
  459. package/_cjs/LogSpan.cjs.map +1 -1
  460. package/_cjs/Logger/api.cjs +0 -7
  461. package/_cjs/Logger/api.cjs.map +1 -1
  462. package/_cjs/Logger/constructors.cjs +2 -17
  463. package/_cjs/Logger/constructors.cjs.map +1 -1
  464. package/_cjs/Logger/definition.cjs +3 -4
  465. package/_cjs/Logger/definition.cjs.map +1 -1
  466. package/_cjs/Logger.cjs +0 -6
  467. package/_cjs/Logger.cjs.map +1 -1
  468. package/_cjs/MVar/api.cjs +170 -0
  469. package/_cjs/MVar/api.cjs.map +1 -0
  470. package/_cjs/MVar/definition.cjs +28 -0
  471. package/_cjs/MVar/definition.cjs.map +1 -0
  472. package/_cjs/MVar.cjs +28 -0
  473. package/_cjs/MVar.cjs.map +1 -0
  474. package/_cjs/Push/api.cjs +477 -0
  475. package/_cjs/Push/api.cjs.map +1 -0
  476. package/_cjs/Push/definition.cjs +50 -0
  477. package/_cjs/Push/definition.cjs.map +1 -0
  478. package/_cjs/Push/internal.cjs +42 -0
  479. package/_cjs/Push/internal.cjs.map +1 -0
  480. package/_cjs/Push.cjs +39 -0
  481. package/_cjs/Push.cjs.map +1 -0
  482. package/_cjs/Queue/api/dimapIO.cjs +174 -0
  483. package/_cjs/Queue/api/dimapIO.cjs.map +1 -0
  484. package/_cjs/Queue/api/filterInputIO.cjs +109 -0
  485. package/_cjs/Queue/api/filterInputIO.cjs.map +1 -0
  486. package/_cjs/Queue/api/filterOutputIO.cjs +117 -0
  487. package/_cjs/Queue/api/filterOutputIO.cjs.map +1 -0
  488. package/_cjs/Queue/api/operations.cjs +133 -0
  489. package/_cjs/Queue/api/operations.cjs.map +1 -0
  490. package/_cjs/{Fiber/api/evalOn.cjs → Queue/api/poll.cjs} +11 -20
  491. package/_cjs/Queue/api/poll.cjs.map +1 -0
  492. package/_cjs/Queue/api/takeBetween.cjs +47 -0
  493. package/_cjs/Queue/api/takeBetween.cjs.map +1 -0
  494. package/_cjs/Queue/api/zipWithIO.cjs +82 -0
  495. package/_cjs/Queue/api/zipWithIO.cjs.map +1 -0
  496. package/_cjs/Queue/api.cjs +83 -0
  497. package/_cjs/Queue/api.cjs.map +1 -0
  498. package/_cjs/Queue/constructors.cjs +5 -32
  499. package/_cjs/Queue/constructors.cjs.map +1 -1
  500. package/_cjs/Queue/definition.cjs +26 -192
  501. package/_cjs/Queue/definition.cjs.map +1 -1
  502. package/_cjs/Queue/internal.cjs +142 -42
  503. package/_cjs/Queue/internal.cjs.map +1 -1
  504. package/_cjs/Queue/strategy.cjs +12 -53
  505. package/_cjs/Queue/strategy.cjs.map +1 -1
  506. package/_cjs/Queue.cjs +22 -6
  507. package/_cjs/Queue.cjs.map +1 -1
  508. package/_cjs/Random/api.cjs +0 -17
  509. package/_cjs/Random/api.cjs.map +1 -1
  510. package/_cjs/Random/definition.cjs +0 -7
  511. package/_cjs/Random/definition.cjs.map +1 -1
  512. package/_cjs/Random/live.cjs +0 -14
  513. package/_cjs/Random/live.cjs.map +1 -1
  514. package/_cjs/Random.cjs +0 -6
  515. package/_cjs/Random.cjs.map +1 -1
  516. package/_cjs/Ref/Atomic.cjs +26 -21
  517. package/_cjs/Ref/Atomic.cjs.map +1 -1
  518. package/_cjs/Ref/Derived.cjs +50 -0
  519. package/_cjs/Ref/Derived.cjs.map +1 -0
  520. package/_cjs/Ref/DerivedAll.cjs +49 -0
  521. package/_cjs/Ref/DerivedAll.cjs.map +1 -0
  522. package/_cjs/Ref/Synchronized/api.cjs +192 -0
  523. package/_cjs/Ref/Synchronized/api.cjs.map +1 -0
  524. package/_cjs/Ref/Synchronized/constructors.cjs +31 -0
  525. package/_cjs/Ref/Synchronized/constructors.cjs.map +1 -0
  526. package/_cjs/Ref/Synchronized/definition.cjs +69 -0
  527. package/_cjs/Ref/Synchronized/definition.cjs.map +1 -0
  528. package/_cjs/Ref/Synchronized.cjs +33 -134
  529. package/_cjs/Ref/Synchronized.cjs.map +1 -1
  530. package/_cjs/{FiberState/constructors.cjs → Ref/api/collect.cjs} +16 -34
  531. package/_cjs/Ref/api/collect.cjs.map +1 -0
  532. package/_cjs/Ref/api/dimap.cjs +105 -0
  533. package/_cjs/Ref/api/dimap.cjs.map +1 -0
  534. package/_cjs/Ref/api/filter.cjs +40 -0
  535. package/_cjs/Ref/api/filter.cjs.map +1 -0
  536. package/_cjs/Ref/api/get.cjs +18 -0
  537. package/_cjs/Ref/api/get.cjs.map +1 -0
  538. package/_cjs/Ref/api/match.cjs +24 -0
  539. package/_cjs/Ref/api/match.cjs.map +1 -0
  540. package/_cjs/Ref/api/matchAll.cjs +22 -0
  541. package/_cjs/Ref/api/matchAll.cjs.map +1 -0
  542. package/_cjs/Ref/api/modify.cjs +141 -0
  543. package/_cjs/Ref/api/modify.cjs.map +1 -0
  544. package/_cjs/Ref/api/set.cjs +21 -0
  545. package/_cjs/Ref/api/set.cjs.map +1 -0
  546. package/_cjs/Ref/api.cjs +134 -0
  547. package/_cjs/Ref/api.cjs.map +1 -0
  548. package/_cjs/Ref/constructors.cjs +4 -30
  549. package/_cjs/Ref/constructors.cjs.map +1 -1
  550. package/_cjs/Ref/definition.cjs +17 -107
  551. package/_cjs/Ref/definition.cjs.map +1 -1
  552. package/_cjs/Ref.cjs +66 -8
  553. package/_cjs/Ref.cjs.map +1 -1
  554. package/_cjs/RefSubject/Atomic.cjs +109 -0
  555. package/_cjs/RefSubject/Atomic.cjs.map +1 -0
  556. package/_cjs/{Fiber/api/evalOnIO.cjs → RefSubject/Synchronized/api.cjs} +13 -23
  557. package/_cjs/RefSubject/Synchronized/api.cjs.map +1 -0
  558. package/_cjs/RefSubject/Synchronized/definition.cjs +56 -0
  559. package/_cjs/RefSubject/Synchronized/definition.cjs.map +1 -0
  560. package/_cjs/RefSubject/api.cjs +245 -0
  561. package/_cjs/RefSubject/api.cjs.map +1 -0
  562. package/_cjs/RefSubject/definition.cjs +26 -0
  563. package/_cjs/RefSubject/definition.cjs.map +1 -0
  564. package/_cjs/{FiberState.cjs → RefSubject.cjs} +7 -13
  565. package/_cjs/RefSubject.cjs.map +1 -0
  566. package/_cjs/Reloadable/api.cjs +3 -18
  567. package/_cjs/Reloadable/api.cjs.map +1 -1
  568. package/_cjs/Reloadable/constructors.cjs +5 -32
  569. package/_cjs/Reloadable/constructors.cjs.map +1 -1
  570. package/_cjs/Reloadable/definition.cjs +4 -16
  571. package/_cjs/Reloadable/definition.cjs.map +1 -1
  572. package/_cjs/Reloadable.cjs +0 -6
  573. package/_cjs/Reloadable.cjs.map +1 -1
  574. package/_cjs/RuntimeConfig.cjs +1 -44
  575. package/_cjs/RuntimeConfig.cjs.map +1 -1
  576. package/_cjs/RuntimeFlag.cjs +6 -0
  577. package/_cjs/RuntimeFlag.cjs.map +1 -0
  578. package/_cjs/RuntimeFlags/Patch.cjs +76 -0
  579. package/_cjs/RuntimeFlags/Patch.cjs.map +1 -0
  580. package/_cjs/RuntimeFlags/RuntimeFlags.cjs +107 -0
  581. package/_cjs/RuntimeFlags/RuntimeFlags.cjs.map +1 -0
  582. package/_cjs/RuntimeFlags.cjs +28 -0
  583. package/_cjs/RuntimeFlags.cjs.map +1 -0
  584. package/_cjs/STM/api/atomically.cjs +55 -0
  585. package/_cjs/STM/api/atomically.cjs.map +1 -0
  586. package/_cjs/STM/api/core-api.cjs +0 -16
  587. package/_cjs/STM/api/core-api.cjs.map +1 -1
  588. package/_cjs/STM/api/core-constructors.cjs +0 -15
  589. package/_cjs/STM/api/core-constructors.cjs.map +1 -1
  590. package/_cjs/STM/api.cjs +65 -229
  591. package/_cjs/STM/api.cjs.map +1 -1
  592. package/_cjs/STM/definition.cjs +34 -84
  593. package/_cjs/STM/definition.cjs.map +1 -1
  594. package/_cjs/STM/driver.cjs +10 -63
  595. package/_cjs/STM/driver.cjs.map +1 -1
  596. package/_cjs/STM/internal/CommitState.cjs +5 -32
  597. package/_cjs/STM/internal/CommitState.cjs.map +1 -1
  598. package/_cjs/STM/internal/Entry.cjs +6 -23
  599. package/_cjs/STM/internal/Entry.cjs.map +1 -1
  600. package/_cjs/STM/internal/Journal.cjs +17 -113
  601. package/_cjs/STM/internal/Journal.cjs.map +1 -1
  602. package/_cjs/STM/internal/TryCommit.cjs +7 -14
  603. package/_cjs/STM/internal/TryCommit.cjs.map +1 -1
  604. package/_cjs/STM/internal/Versioned.cjs +3 -4
  605. package/_cjs/STM/internal/Versioned.cjs.map +1 -1
  606. package/_cjs/STM.cjs +11 -10
  607. package/_cjs/STM.cjs.map +1 -1
  608. package/_cjs/Schedule/Decision.cjs +4 -30
  609. package/_cjs/Schedule/Decision.cjs.map +1 -1
  610. package/_cjs/Schedule/Driver.cjs +0 -5
  611. package/_cjs/Schedule/Driver.cjs.map +1 -1
  612. package/_cjs/Schedule/api/driver.cjs +16 -28
  613. package/_cjs/Schedule/api/driver.cjs.map +1 -1
  614. package/_cjs/Schedule/api.cjs +109 -252
  615. package/_cjs/Schedule/api.cjs.map +1 -1
  616. package/_cjs/Schedule/definition.cjs +3 -3
  617. package/_cjs/Schedule/definition.cjs.map +1 -1
  618. package/_cjs/Schedule.cjs +0 -8
  619. package/_cjs/Schedule.cjs.map +1 -1
  620. package/_cjs/Scope/Finalizer/definition.cjs +0 -6
  621. package/_cjs/Scope/Finalizer/definition.cjs.map +1 -1
  622. package/_cjs/Scope/Finalizer.cjs +0 -2
  623. package/_cjs/Scope/Finalizer.cjs.map +1 -1
  624. package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +4 -15
  625. package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs.map +1 -1
  626. package/_cjs/Scope/ReleaseMap/api.cjs +12 -33
  627. package/_cjs/Scope/ReleaseMap/api.cjs.map +1 -1
  628. package/_cjs/Scope/ReleaseMap/constructors.cjs +1 -12
  629. package/_cjs/Scope/ReleaseMap/constructors.cjs.map +1 -1
  630. package/_cjs/Scope/ReleaseMap/definition.cjs +0 -9
  631. package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
  632. package/_cjs/Scope/ReleaseMap.cjs +0 -6
  633. package/_cjs/Scope/ReleaseMap.cjs.map +1 -1
  634. package/_cjs/Scope/api.cjs +1 -44
  635. package/_cjs/Scope/api.cjs.map +1 -1
  636. package/_cjs/Scope/definition.cjs +5 -15
  637. package/_cjs/Scope/definition.cjs.map +1 -1
  638. package/_cjs/Scope.cjs +0 -4
  639. package/_cjs/Scope.cjs.map +1 -1
  640. package/_cjs/ScopedRef/api.cjs +9 -24
  641. package/_cjs/ScopedRef/api.cjs.map +1 -1
  642. package/_cjs/ScopedRef/definition.cjs +3 -5
  643. package/_cjs/ScopedRef/definition.cjs.map +1 -1
  644. package/_cjs/ScopedRef.cjs +0 -4
  645. package/_cjs/ScopedRef.cjs.map +1 -1
  646. package/_cjs/Sink/api.cjs +134 -384
  647. package/_cjs/Sink/api.cjs.map +1 -1
  648. package/_cjs/Sink/definition.cjs +0 -3
  649. package/_cjs/Sink/definition.cjs.map +1 -1
  650. package/_cjs/Sink.cjs +0 -4
  651. package/_cjs/Sink.cjs.map +1 -1
  652. package/_cjs/State/api.cjs +2 -20
  653. package/_cjs/State/api.cjs.map +1 -1
  654. package/_cjs/State/definition.cjs +6 -9
  655. package/_cjs/State/definition.cjs.map +1 -1
  656. package/_cjs/State/internal.cjs +7 -6
  657. package/_cjs/State/internal.cjs.map +1 -1
  658. package/_cjs/State.cjs +0 -4
  659. package/_cjs/State.cjs.map +1 -1
  660. package/_cjs/Stream/api/zipAllWith.cjs +2 -31
  661. package/_cjs/Stream/api/zipAllWith.cjs.map +1 -1
  662. package/_cjs/Stream/api/zipWith.cjs +0 -5
  663. package/_cjs/Stream/api/zipWith.cjs.map +1 -1
  664. package/_cjs/Stream/api/zipWithChunks.cjs +2 -22
  665. package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -1
  666. package/_cjs/Stream/api.cjs +237 -685
  667. package/_cjs/Stream/api.cjs.map +1 -1
  668. package/_cjs/Stream/definition.cjs +4 -10
  669. package/_cjs/Stream/definition.cjs.map +1 -1
  670. package/_cjs/Stream/internal/DebounceState.cjs +6 -36
  671. package/_cjs/Stream/internal/DebounceState.cjs.map +1 -1
  672. package/_cjs/Stream/internal/Handoff.cjs +42 -90
  673. package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
  674. package/_cjs/Stream/internal/Pull.cjs +10 -31
  675. package/_cjs/Stream/internal/Pull.cjs.map +1 -1
  676. package/_cjs/Stream/internal/SinkEndReason.cjs +10 -24
  677. package/_cjs/Stream/internal/SinkEndReason.cjs.map +1 -1
  678. package/_cjs/Stream/internal/Take.cjs +0 -51
  679. package/_cjs/Stream/internal/Take.cjs.map +1 -1
  680. package/_cjs/Stream/internal/util.cjs +0 -10
  681. package/_cjs/Stream/internal/util.cjs.map +1 -1
  682. package/_cjs/Stream.cjs +0 -4
  683. package/_cjs/Stream.cjs.map +1 -1
  684. package/_cjs/{IO/api/withRuntimeConfig.cjs → Subject/Atomic.cjs} +25 -19
  685. package/_cjs/Subject/Atomic.cjs.map +1 -0
  686. package/_cjs/{FiberState → Subject}/api.cjs +17 -15
  687. package/_cjs/Subject/api.cjs.map +1 -0
  688. package/_cjs/Subject/definition.cjs +11 -0
  689. package/_cjs/Subject/definition.cjs.map +1 -0
  690. package/_cjs/Subject.cjs +39 -0
  691. package/_cjs/Subject.cjs.map +1 -0
  692. package/_cjs/SubscriptionRef.cjs +22 -36
  693. package/_cjs/SubscriptionRef.cjs.map +1 -1
  694. package/_cjs/Supervisor/api.cjs +4 -21
  695. package/_cjs/Supervisor/api.cjs.map +1 -1
  696. package/_cjs/Supervisor/constructors.cjs +0 -24
  697. package/_cjs/Supervisor/constructors.cjs.map +1 -1
  698. package/_cjs/Supervisor/definition.cjs +5 -43
  699. package/_cjs/Supervisor/definition.cjs.map +1 -1
  700. package/_cjs/Supervisor.cjs +0 -6
  701. package/_cjs/Supervisor.cjs.map +1 -1
  702. package/_cjs/SupervisorPatch.cjs +13 -65
  703. package/_cjs/SupervisorPatch.cjs.map +1 -1
  704. package/_cjs/TExit/constructors.cjs +0 -12
  705. package/_cjs/TExit/constructors.cjs.map +1 -1
  706. package/_cjs/TExit/definition.cjs +36 -97
  707. package/_cjs/TExit/definition.cjs.map +1 -1
  708. package/_cjs/TExit.cjs +0 -4
  709. package/_cjs/TExit.cjs.map +1 -1
  710. package/_cjs/TFuture/api.cjs +0 -22
  711. package/_cjs/TFuture/api.cjs.map +1 -1
  712. package/_cjs/TFuture/constructors.cjs +1 -13
  713. package/_cjs/TFuture/constructors.cjs.map +1 -1
  714. package/_cjs/TFuture/definition.cjs +0 -4
  715. package/_cjs/TFuture/definition.cjs.map +1 -1
  716. package/_cjs/TFuture.cjs +0 -6
  717. package/_cjs/TFuture.cjs.map +1 -1
  718. package/_cjs/TReentrantLock/api.cjs +17 -90
  719. package/_cjs/TReentrantLock/api.cjs.map +1 -1
  720. package/_cjs/TReentrantLock/definition.cjs +3 -34
  721. package/_cjs/TReentrantLock/definition.cjs.map +1 -1
  722. package/_cjs/TReentrantLock.cjs +0 -4
  723. package/_cjs/TReentrantLock.cjs.map +1 -1
  724. package/_cjs/TRef/api.cjs +23 -248
  725. package/_cjs/TRef/api.cjs.map +1 -1
  726. package/_cjs/TRef/constructors.cjs +1 -20
  727. package/_cjs/TRef/constructors.cjs.map +1 -1
  728. package/_cjs/TRef/definition.cjs +85 -35
  729. package/_cjs/TRef/definition.cjs.map +1 -1
  730. package/_cjs/TRef.cjs +0 -6
  731. package/_cjs/TRef.cjs.map +1 -1
  732. package/_cjs/TSemaphore/api.cjs +5 -28
  733. package/_cjs/TSemaphore/api.cjs.map +1 -1
  734. package/_cjs/TSemaphore/constructors.cjs +1 -14
  735. package/_cjs/TSemaphore/constructors.cjs.map +1 -1
  736. package/_cjs/TSemaphore/definition.cjs +0 -4
  737. package/_cjs/TSemaphore/definition.cjs.map +1 -1
  738. package/_cjs/TSemaphore.cjs +0 -6
  739. package/_cjs/TSemaphore.cjs.map +1 -1
  740. package/_cjs/TxnId.cjs +0 -3
  741. package/_cjs/TxnId.cjs.map +1 -1
  742. package/_cjs/collection/immutable/Conc/dropUntilIO.cjs +0 -7
  743. package/_cjs/collection/immutable/Conc/dropUntilIO.cjs.map +1 -1
  744. package/_cjs/collection/immutable/Conc/dropWhileIO.cjs +0 -7
  745. package/_cjs/collection/immutable/Conc/dropWhileIO.cjs.map +1 -1
  746. package/_cjs/collection/immutable/Conc/filterIO.cjs +0 -7
  747. package/_cjs/collection/immutable/Conc/filterIO.cjs.map +1 -1
  748. package/_cjs/collection/immutable/Conc/findIO.cjs +0 -12
  749. package/_cjs/collection/immutable/Conc/findIO.cjs.map +1 -1
  750. package/_cjs/collection/immutable/Conc/mapIO.cjs +0 -5
  751. package/_cjs/collection/immutable/Conc/mapIO.cjs.map +1 -1
  752. package/_cjs/collection/immutable/Conc/takeWhileIO.cjs +0 -9
  753. package/_cjs/collection/immutable/Conc/takeWhileIO.cjs.map +1 -1
  754. package/_cjs/collection/immutable/Conc.cjs +0 -12
  755. package/_cjs/collection/immutable/Conc.cjs.map +1 -1
  756. package/_cjs/data/Exit/foreachIO.cjs +0 -6
  757. package/_cjs/data/Exit/foreachIO.cjs.map +1 -1
  758. package/_cjs/internal/HashedPair.cjs +4 -15
  759. package/_cjs/internal/HashedPair.cjs.map +1 -1
  760. package/_cjs/internal/Hub.cjs +0 -164
  761. package/_cjs/internal/Hub.cjs.map +1 -1
  762. package/_cjs/internal/IsFatal.cjs +13 -53
  763. package/_cjs/internal/IsFatal.cjs.map +1 -1
  764. package/_cjs/internal/MutableQueue.cjs +0 -68
  765. package/_cjs/internal/MutableQueue.cjs.map +1 -1
  766. package/_cjs/internal/Scheduler.cjs +0 -18
  767. package/_cjs/internal/Scheduler.cjs.map +1 -1
  768. package/_cjs/internal/StackTraceBuilder.cjs +0 -9
  769. package/_cjs/internal/StackTraceBuilder.cjs.map +1 -1
  770. package/_mjs/Cached/api.mjs +1 -8
  771. package/_mjs/Cached/api.mjs.map +1 -1
  772. package/_mjs/Cached/definition.mjs +6 -6
  773. package/_mjs/Cached/definition.mjs.map +1 -1
  774. package/_mjs/Cached/internal.mjs +3 -6
  775. package/_mjs/Cached/internal.mjs.map +1 -1
  776. package/_mjs/Cached.mjs.map +1 -1
  777. package/_mjs/CancellerState.mjs +6 -15
  778. package/_mjs/CancellerState.mjs.map +1 -1
  779. package/_mjs/Channel/ChildExecutorDecision/api.mjs +0 -2
  780. package/_mjs/Channel/ChildExecutorDecision/api.mjs.map +1 -1
  781. package/_mjs/Channel/ChildExecutorDecision/definition.mjs +0 -2
  782. package/_mjs/Channel/ChildExecutorDecision/definition.mjs.map +1 -1
  783. package/_mjs/Channel/ChildExecutorDecision.mjs.map +1 -1
  784. package/_mjs/Channel/UpstreamPullRequest/api.mjs +0 -4
  785. package/_mjs/Channel/UpstreamPullRequest/api.mjs.map +1 -1
  786. package/_mjs/Channel/UpstreamPullRequest/definition.mjs +0 -2
  787. package/_mjs/Channel/UpstreamPullRequest/definition.mjs.map +1 -1
  788. package/_mjs/Channel/UpstreamPullRequest.mjs.map +1 -1
  789. package/_mjs/Channel/UpstreamPullStrategy/definition.mjs +0 -1
  790. package/_mjs/Channel/UpstreamPullStrategy/definition.mjs.map +1 -1
  791. package/_mjs/Channel/UpstreamPullStrategy.mjs.map +1 -1
  792. package/_mjs/Channel/api/interruptWhen.mjs +0 -3
  793. package/_mjs/Channel/api/interruptWhen.mjs.map +1 -1
  794. package/_mjs/Channel/api/mapOutConcurrentIO.mjs +34 -0
  795. package/_mjs/Channel/api/mapOutConcurrentIO.mjs.map +1 -0
  796. package/_mjs/Channel/api/mergeAll.mjs +0 -1
  797. package/_mjs/Channel/api/mergeAll.mjs.map +1 -1
  798. package/_mjs/Channel/api/mergeAllUnboundedWith.mjs +0 -1
  799. package/_mjs/Channel/api/mergeAllUnboundedWith.mjs.map +1 -1
  800. package/_mjs/Channel/api/mergeAllWith.mjs +39 -38
  801. package/_mjs/Channel/api/mergeAllWith.mjs.map +1 -1
  802. package/_mjs/Channel/api/mergeMap.mjs +0 -1
  803. package/_mjs/Channel/api/mergeMap.mjs.map +1 -1
  804. package/_mjs/Channel/api/mergeWith.mjs +10 -28
  805. package/_mjs/Channel/api/mergeWith.mjs.map +1 -1
  806. package/_mjs/Channel/api/run.mjs +0 -1
  807. package/_mjs/Channel/api/run.mjs.map +1 -1
  808. package/_mjs/Channel/api/runCollect.mjs +0 -1
  809. package/_mjs/Channel/api/runCollect.mjs.map +1 -1
  810. package/_mjs/Channel/api/runDrain.mjs +0 -1
  811. package/_mjs/Channel/api/runDrain.mjs.map +1 -1
  812. package/_mjs/Channel/api/runScoped.mjs +4 -19
  813. package/_mjs/Channel/api/runScoped.mjs.map +1 -1
  814. package/_mjs/Channel/api/toPull.mjs +4 -17
  815. package/_mjs/Channel/api/toPull.mjs.map +1 -1
  816. package/_mjs/Channel/api/zipConcurrent.mjs +32 -0
  817. package/_mjs/Channel/api/zipConcurrent.mjs.map +1 -0
  818. package/_mjs/Channel/api.mjs +79 -195
  819. package/_mjs/Channel/api.mjs.map +1 -1
  820. package/_mjs/Channel/core-api.mjs +4 -21
  821. package/_mjs/Channel/core-api.mjs.map +1 -1
  822. package/_mjs/Channel/definition.mjs +40 -67
  823. package/_mjs/Channel/definition.mjs.map +1 -1
  824. package/_mjs/Channel/internal/ChannelExecutor.mjs +117 -291
  825. package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
  826. package/_mjs/Channel/internal/ChannelState.mjs +5 -20
  827. package/_mjs/Channel/internal/ChannelState.mjs.map +1 -1
  828. package/_mjs/Channel/internal/MergeDecision.mjs +9 -17
  829. package/_mjs/Channel/internal/MergeDecision.mjs.map +1 -1
  830. package/_mjs/Channel/internal/MergeState.mjs +6 -15
  831. package/_mjs/Channel/internal/MergeState.mjs.map +1 -1
  832. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs +44 -106
  833. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs.map +1 -1
  834. package/_mjs/Channel.mjs.map +1 -1
  835. package/_mjs/Clock/api.mjs +0 -2
  836. package/_mjs/Clock/api.mjs.map +1 -1
  837. package/_mjs/Clock/definition.mjs +0 -2
  838. package/_mjs/Clock/definition.mjs.map +1 -1
  839. package/_mjs/Clock/live.mjs +2 -6
  840. package/_mjs/Clock/live.mjs.map +1 -1
  841. package/_mjs/Clock.mjs.map +1 -1
  842. package/_mjs/Console/api.mjs +0 -2
  843. package/_mjs/Console/api.mjs.map +1 -1
  844. package/_mjs/Console/definition.mjs +0 -2
  845. package/_mjs/Console/definition.mjs.map +1 -1
  846. package/_mjs/Console/live.mjs +0 -4
  847. package/_mjs/Console/live.mjs.map +1 -1
  848. package/_mjs/Console.mjs.map +1 -1
  849. package/_mjs/CountdownLatch.mjs +41 -0
  850. package/_mjs/CountdownLatch.mjs.map +1 -0
  851. package/_mjs/Differ/api.mjs +0 -15
  852. package/_mjs/Differ/api.mjs.map +1 -1
  853. package/_mjs/Differ/definition.mjs +3 -3
  854. package/_mjs/Differ/definition.mjs.map +1 -1
  855. package/_mjs/Fiber/FiberMessage.mjs +56 -0
  856. package/_mjs/Fiber/FiberMessage.mjs.map +1 -0
  857. package/_mjs/Fiber/FiberRuntime.mjs +735 -0
  858. package/_mjs/Fiber/FiberRuntime.mjs.map +1 -0
  859. package/_mjs/Fiber/api/await.mjs.map +1 -1
  860. package/_mjs/Fiber/api/awaitAll.mjs +2 -3
  861. package/_mjs/Fiber/api/awaitAll.mjs.map +1 -1
  862. package/_mjs/Fiber/api/children.mjs.map +1 -1
  863. package/_mjs/Fiber/api/collectAll.mjs +3 -4
  864. package/_mjs/Fiber/api/collectAll.mjs.map +1 -1
  865. package/_mjs/Fiber/api/fromIO.mjs +0 -1
  866. package/_mjs/Fiber/api/fromIO.mjs.map +1 -1
  867. package/_mjs/Fiber/api/id.mjs.map +1 -1
  868. package/_mjs/Fiber/api/inheritRefs.mjs +1 -1
  869. package/_mjs/Fiber/api/inheritRefs.mjs.map +1 -1
  870. package/_mjs/Fiber/api/interrupt.mjs +3 -4
  871. package/_mjs/Fiber/api/interrupt.mjs.map +1 -1
  872. package/_mjs/Fiber/api/interruptAll.mjs +2 -5
  873. package/_mjs/Fiber/api/interruptAll.mjs.map +1 -1
  874. package/_mjs/Fiber/api/interruptAs.mjs +14 -8
  875. package/_mjs/Fiber/api/interruptAs.mjs.map +1 -1
  876. package/_mjs/Fiber/api/interruptFork.mjs +2 -5
  877. package/_mjs/Fiber/api/interruptFork.mjs.map +1 -1
  878. package/_mjs/Fiber/api/join.mjs +3 -3
  879. package/_mjs/Fiber/api/join.mjs.map +1 -1
  880. package/_mjs/Fiber/api/joinAll.mjs +0 -1
  881. package/_mjs/Fiber/api/joinAll.mjs.map +1 -1
  882. package/_mjs/Fiber/api/location.mjs +1 -3
  883. package/_mjs/Fiber/api/location.mjs.map +1 -1
  884. package/_mjs/Fiber/api/mapFiber.mjs +0 -1
  885. package/_mjs/Fiber/api/mapFiber.mjs.map +1 -1
  886. package/_mjs/Fiber/api/mapIO.mjs +1 -4
  887. package/_mjs/Fiber/api/mapIO.mjs.map +1 -1
  888. package/_mjs/Fiber/api/poll.mjs.map +1 -1
  889. package/_mjs/Fiber/api/zipWith.mjs +2 -3
  890. package/_mjs/Fiber/api/zipWith.mjs.map +1 -1
  891. package/_mjs/Fiber/constructors.mjs +0 -6
  892. package/_mjs/Fiber/constructors.mjs.map +1 -1
  893. package/_mjs/Fiber/definition.mjs +14 -7
  894. package/_mjs/Fiber/definition.mjs.map +1 -1
  895. package/_mjs/Fiber.mjs +3 -5
  896. package/_mjs/Fiber.mjs.map +1 -1
  897. package/_mjs/FiberDescriptor.mjs +1 -4
  898. package/_mjs/FiberDescriptor.mjs.map +1 -1
  899. package/_mjs/FiberRef/api/locallyScoped.mjs +0 -1
  900. package/_mjs/FiberRef/api/locallyScoped.mjs.map +1 -1
  901. package/_mjs/FiberRef/api/locallyScopedWith.mjs +0 -1
  902. package/_mjs/FiberRef/api/locallyScopedWith.mjs.map +1 -1
  903. package/_mjs/FiberRef/api.mjs +16 -34
  904. package/_mjs/FiberRef/api.mjs.map +1 -1
  905. package/_mjs/FiberRef/constructors.mjs +0 -3
  906. package/_mjs/FiberRef/constructors.mjs.map +1 -1
  907. package/_mjs/FiberRef/definition.mjs +11 -13
  908. package/_mjs/FiberRef/definition.mjs.map +1 -1
  909. package/_mjs/FiberRef/unsafe.mjs +17 -30
  910. package/_mjs/FiberRef/unsafe.mjs.map +1 -1
  911. package/_mjs/FiberRef.mjs +2 -2
  912. package/_mjs/FiberRef.mjs.map +1 -1
  913. package/_mjs/FiberRefs/api.mjs +55 -11
  914. package/_mjs/FiberRefs/api.mjs.map +1 -1
  915. package/_mjs/FiberRefs/definition.mjs +2 -13
  916. package/_mjs/FiberRefs/definition.mjs.map +1 -1
  917. package/_mjs/FiberRefs/join.mjs +34 -46
  918. package/_mjs/FiberRefs/join.mjs.map +1 -1
  919. package/_mjs/FiberRefs.mjs.map +1 -1
  920. package/_mjs/FiberScope/constructors.mjs +0 -2
  921. package/_mjs/FiberScope/constructors.mjs.map +1 -1
  922. package/_mjs/FiberScope/definition.mjs +15 -12
  923. package/_mjs/FiberScope/definition.mjs.map +1 -1
  924. package/_mjs/FiberScope.mjs.map +1 -1
  925. package/_mjs/FiberStatus/constructors.mjs +5 -15
  926. package/_mjs/FiberStatus/constructors.mjs.map +1 -1
  927. package/_mjs/FiberStatus/definition.mjs +14 -66
  928. package/_mjs/FiberStatus/definition.mjs.map +1 -1
  929. package/_mjs/FiberStatus.mjs.map +1 -1
  930. package/_mjs/Future/api.mjs +28 -58
  931. package/_mjs/Future/api.mjs.map +1 -1
  932. package/_mjs/Future/constructors.mjs +0 -4
  933. package/_mjs/Future/constructors.mjs.map +1 -1
  934. package/_mjs/Future/definition.mjs +3 -9
  935. package/_mjs/Future/definition.mjs.map +1 -1
  936. package/_mjs/Future.mjs.map +1 -1
  937. package/_mjs/Hub/api.mjs +359 -0
  938. package/_mjs/Hub/api.mjs.map +1 -0
  939. package/_mjs/Hub/definition.mjs +17 -85
  940. package/_mjs/Hub/definition.mjs.map +1 -1
  941. package/_mjs/Hub/internal.mjs +102 -145
  942. package/_mjs/Hub/internal.mjs.map +1 -1
  943. package/_mjs/Hub.mjs +1 -1
  944. package/_mjs/Hub.mjs.map +1 -1
  945. package/_mjs/IO/api/acquireRelease.mjs +0 -1
  946. package/_mjs/IO/api/acquireRelease.mjs.map +1 -1
  947. package/_mjs/IO/api/acquireReleaseExit.mjs +0 -1
  948. package/_mjs/IO/api/acquireReleaseExit.mjs.map +1 -1
  949. package/_mjs/IO/api/acquireReleaseInterruptible.mjs +0 -1
  950. package/_mjs/IO/api/acquireReleaseInterruptible.mjs.map +1 -1
  951. package/_mjs/IO/api/acquireReleaseInterruptibleExit.mjs +2 -2
  952. package/_mjs/IO/api/acquireReleaseInterruptibleExit.mjs.map +1 -1
  953. package/_mjs/IO/api/addFinalizer.mjs +0 -1
  954. package/_mjs/IO/api/addFinalizer.mjs.map +1 -1
  955. package/_mjs/IO/api/addFinalizerExit.mjs +0 -1
  956. package/_mjs/IO/api/addFinalizerExit.mjs.map +1 -1
  957. package/_mjs/IO/api/asyncIO.mjs +7 -7
  958. package/_mjs/IO/api/asyncIO.mjs.map +1 -1
  959. package/_mjs/IO/api/asyncInterrupt.mjs +65 -0
  960. package/_mjs/IO/api/asyncInterrupt.mjs.map +1 -0
  961. package/_mjs/IO/api/bracket.mjs +0 -1
  962. package/_mjs/IO/api/bracket.mjs.map +1 -1
  963. package/_mjs/IO/api/bracketExit.mjs +1 -2
  964. package/_mjs/IO/api/bracketExit.mjs.map +1 -1
  965. package/_mjs/IO/api/clockWith.mjs +0 -3
  966. package/_mjs/IO/api/clockWith.mjs.map +1 -1
  967. package/_mjs/IO/api/concurrency.mjs +0 -5
  968. package/_mjs/IO/api/concurrency.mjs.map +1 -1
  969. package/_mjs/IO/api/concurrentFinalizers.mjs +0 -1
  970. package/_mjs/IO/api/concurrentFinalizers.mjs.map +1 -1
  971. package/_mjs/IO/api/consoleWith.mjs +0 -3
  972. package/_mjs/IO/api/consoleWith.mjs.map +1 -1
  973. package/_mjs/IO/api/core-scope.mjs +46 -88
  974. package/_mjs/IO/api/core-scope.mjs.map +1 -1
  975. package/_mjs/IO/api/delay.mjs +12 -0
  976. package/_mjs/IO/api/delay.mjs.map +1 -0
  977. package/_mjs/IO/api/ensuringChildren.mjs +3 -3
  978. package/_mjs/IO/api/ensuringChildren.mjs.map +1 -1
  979. package/_mjs/IO/api/environment.mjs +0 -15
  980. package/_mjs/IO/api/environment.mjs.map +1 -1
  981. package/_mjs/IO/api/{foreachC.mjs → foreachConcurrent.mjs} +30 -42
  982. package/_mjs/IO/api/foreachConcurrent.mjs.map +1 -0
  983. package/_mjs/IO/api/foreachExec.mjs +2 -3
  984. package/_mjs/IO/api/foreachExec.mjs.map +1 -1
  985. package/_mjs/IO/api/fork.mjs +64 -0
  986. package/_mjs/IO/api/fork.mjs.map +1 -0
  987. package/_mjs/IO/api/forkAll.mjs +3 -3
  988. package/_mjs/IO/api/forkAll.mjs.map +1 -1
  989. package/_mjs/IO/api/forkIn.mjs +1 -2
  990. package/_mjs/IO/api/forkIn.mjs.map +1 -1
  991. package/_mjs/IO/api/forkScoped.mjs +1 -2
  992. package/_mjs/IO/api/forkScoped.mjs.map +1 -1
  993. package/_mjs/IO/api/fulfill.mjs +1 -2
  994. package/_mjs/IO/api/fulfill.mjs.map +1 -1
  995. package/_mjs/IO/api/interrupt.mjs +68 -79
  996. package/_mjs/IO/api/interrupt.mjs.map +1 -1
  997. package/_mjs/IO/api/memoize.mjs +1 -2
  998. package/_mjs/IO/api/memoize.mjs.map +1 -1
  999. package/_mjs/IO/api/onTermination.mjs +7 -7
  1000. package/_mjs/IO/api/onTermination.mjs.map +1 -1
  1001. package/_mjs/IO/api/once.mjs +4 -4
  1002. package/_mjs/IO/api/once.mjs.map +1 -1
  1003. package/_mjs/IO/api/provideLayer.mjs +0 -1
  1004. package/_mjs/IO/api/provideLayer.mjs.map +1 -1
  1005. package/_mjs/IO/api/provideSomeLayer.mjs +0 -1
  1006. package/_mjs/IO/api/provideSomeLayer.mjs.map +1 -1
  1007. package/_mjs/IO/api/race.mjs +4 -6
  1008. package/_mjs/IO/api/race.mjs.map +1 -1
  1009. package/_mjs/IO/api/raceFirst.mjs +1 -2
  1010. package/_mjs/IO/api/raceFirst.mjs.map +1 -1
  1011. package/_mjs/IO/api/randomWith.mjs +0 -3
  1012. package/_mjs/IO/api/randomWith.mjs.map +1 -1
  1013. package/_mjs/IO/api/repeat.mjs +0 -5
  1014. package/_mjs/IO/api/repeat.mjs.map +1 -1
  1015. package/_mjs/IO/api/retry.mjs +0 -6
  1016. package/_mjs/IO/api/retry.mjs.map +1 -1
  1017. package/_mjs/IO/api/schedule.mjs +0 -4
  1018. package/_mjs/IO/api/schedule.mjs.map +1 -1
  1019. package/_mjs/IO/api/scope.mjs +0 -1
  1020. package/_mjs/IO/api/scope.mjs.map +1 -1
  1021. package/_mjs/IO/api/scopeWith.mjs +0 -1
  1022. package/_mjs/IO/api/scopeWith.mjs.map +1 -1
  1023. package/_mjs/IO/api/scoped.mjs +0 -3
  1024. package/_mjs/IO/api/scoped.mjs.map +1 -1
  1025. package/_mjs/IO/api/sequenceT.mjs +1 -2
  1026. package/_mjs/IO/api/sequenceT.mjs.map +1 -1
  1027. package/_mjs/IO/api/sleep.mjs +0 -1
  1028. package/_mjs/IO/api/sleep.mjs.map +1 -1
  1029. package/_mjs/IO/api/stateful.mjs +0 -1
  1030. package/_mjs/IO/api/stateful.mjs.map +1 -1
  1031. package/_mjs/IO/api/supervised.mjs +6 -12
  1032. package/_mjs/IO/api/supervised.mjs.map +1 -1
  1033. package/_mjs/IO/api/timeout.mjs +0 -3
  1034. package/_mjs/IO/api/timeout.mjs.map +1 -1
  1035. package/_mjs/IO/api/withChildren.mjs +2 -4
  1036. package/_mjs/IO/api/withChildren.mjs.map +1 -1
  1037. package/_mjs/IO/api/withEarlyRelease.mjs +0 -1
  1038. package/_mjs/IO/api/withEarlyRelease.mjs.map +1 -1
  1039. package/_mjs/IO/api/withFinalizer.mjs +0 -1
  1040. package/_mjs/IO/api/withFinalizer.mjs.map +1 -1
  1041. package/_mjs/IO/api/withFinalizerExit.mjs +0 -1
  1042. package/_mjs/IO/api/withFinalizerExit.mjs.map +1 -1
  1043. package/_mjs/IO/api/zipConcurrent.mjs +41 -0
  1044. package/_mjs/IO/api/zipConcurrent.mjs.map +1 -0
  1045. package/_mjs/IO/api.mjs +164 -517
  1046. package/_mjs/IO/api.mjs.map +1 -1
  1047. package/_mjs/IO/definition.mjs +115 -154
  1048. package/_mjs/IO/definition.mjs.map +1 -1
  1049. package/_mjs/IO/runtime.mjs +51 -86
  1050. package/_mjs/IO/runtime.mjs.map +1 -1
  1051. package/_mjs/IO.mjs +7 -6
  1052. package/_mjs/IO.mjs.map +1 -1
  1053. package/_mjs/IOEnv/definition.mjs +0 -1
  1054. package/_mjs/IOEnv/definition.mjs.map +1 -1
  1055. package/_mjs/IOEnv/live.mjs +0 -1
  1056. package/_mjs/IOEnv/live.mjs.map +1 -1
  1057. package/_mjs/IOEnv/services.mjs +0 -1
  1058. package/_mjs/IOEnv/services.mjs.map +1 -1
  1059. package/_mjs/IOEnv.mjs.map +1 -1
  1060. package/_mjs/InterruptStatus/constructors.mjs +0 -3
  1061. package/_mjs/InterruptStatus/constructors.mjs.map +1 -1
  1062. package/_mjs/InterruptStatus/definition.mjs +0 -3
  1063. package/_mjs/InterruptStatus/definition.mjs.map +1 -1
  1064. package/_mjs/InterruptStatus.mjs.map +1 -1
  1065. package/_mjs/Layer/MemoMap.mjs +38 -66
  1066. package/_mjs/Layer/MemoMap.mjs.map +1 -1
  1067. package/_mjs/Layer/api.mjs +6 -71
  1068. package/_mjs/Layer/api.mjs.map +1 -1
  1069. package/_mjs/Layer/definition.mjs +17 -35
  1070. package/_mjs/Layer/definition.mjs.map +1 -1
  1071. package/_mjs/Layer.mjs.map +1 -1
  1072. package/_mjs/LogLevel.mjs +0 -13
  1073. package/_mjs/LogLevel.mjs.map +1 -1
  1074. package/_mjs/LogSpan.mjs +0 -4
  1075. package/_mjs/LogSpan.mjs.map +1 -1
  1076. package/_mjs/Logger/api.mjs +0 -2
  1077. package/_mjs/Logger/api.mjs.map +1 -1
  1078. package/_mjs/Logger/constructors.mjs +2 -10
  1079. package/_mjs/Logger/constructors.mjs.map +1 -1
  1080. package/_mjs/Logger/definition.mjs +1 -1
  1081. package/_mjs/Logger/definition.mjs.map +1 -1
  1082. package/_mjs/Logger.mjs.map +1 -1
  1083. package/_mjs/MVar/api.mjs +150 -0
  1084. package/_mjs/MVar/api.mjs.map +1 -0
  1085. package/_mjs/MVar/definition.mjs +18 -0
  1086. package/_mjs/MVar/definition.mjs.map +1 -0
  1087. package/_mjs/MVar.mjs +4 -0
  1088. package/_mjs/MVar.mjs.map +1 -0
  1089. package/_mjs/Push/api.mjs +420 -0
  1090. package/_mjs/Push/api.mjs.map +1 -0
  1091. package/_mjs/Push/definition.mjs +38 -0
  1092. package/_mjs/Push/definition.mjs.map +1 -0
  1093. package/_mjs/Push/internal.mjs +28 -0
  1094. package/_mjs/Push/internal.mjs.map +1 -0
  1095. package/_mjs/Push.mjs +5 -0
  1096. package/_mjs/Push.mjs.map +1 -0
  1097. package/_mjs/Queue/api/dimapIO.mjs +156 -0
  1098. package/_mjs/Queue/api/dimapIO.mjs.map +1 -0
  1099. package/_mjs/Queue/api/filterInputIO.mjs +98 -0
  1100. package/_mjs/Queue/api/filterInputIO.mjs.map +1 -0
  1101. package/_mjs/Queue/api/filterOutputIO.mjs +106 -0
  1102. package/_mjs/Queue/api/filterOutputIO.mjs.map +1 -0
  1103. package/_mjs/Queue/api/operations.mjs +118 -0
  1104. package/_mjs/Queue/api/operations.mjs.map +1 -0
  1105. package/_mjs/Queue/api/poll.mjs +13 -0
  1106. package/_mjs/Queue/api/poll.mjs.map +1 -0
  1107. package/_mjs/Queue/api/takeBetween.mjs +39 -0
  1108. package/_mjs/Queue/api/takeBetween.mjs.map +1 -0
  1109. package/_mjs/Queue/api/zipWithIO.mjs +71 -0
  1110. package/_mjs/Queue/api/zipWithIO.mjs.map +1 -0
  1111. package/_mjs/Queue/api.mjs +9 -0
  1112. package/_mjs/Queue/api.mjs.map +1 -0
  1113. package/_mjs/Queue/constructors.mjs +5 -20
  1114. package/_mjs/Queue/constructors.mjs.map +1 -1
  1115. package/_mjs/Queue/definition.mjs +18 -172
  1116. package/_mjs/Queue/definition.mjs.map +1 -1
  1117. package/_mjs/Queue/internal.mjs +141 -28
  1118. package/_mjs/Queue/internal.mjs.map +1 -1
  1119. package/_mjs/Queue/strategy.mjs +12 -36
  1120. package/_mjs/Queue/strategy.mjs.map +1 -1
  1121. package/_mjs/Queue.mjs +3 -1
  1122. package/_mjs/Queue.mjs.map +1 -1
  1123. package/_mjs/Random/api.mjs +0 -8
  1124. package/_mjs/Random/api.mjs.map +1 -1
  1125. package/_mjs/Random/definition.mjs +0 -2
  1126. package/_mjs/Random/definition.mjs.map +1 -1
  1127. package/_mjs/Random/live.mjs +0 -7
  1128. package/_mjs/Random/live.mjs.map +1 -1
  1129. package/_mjs/Random.mjs.map +1 -1
  1130. package/_mjs/Ref/Atomic.mjs +25 -15
  1131. package/_mjs/Ref/Atomic.mjs.map +1 -1
  1132. package/_mjs/Ref/Derived.mjs +40 -0
  1133. package/_mjs/Ref/Derived.mjs.map +1 -0
  1134. package/_mjs/Ref/DerivedAll.mjs +39 -0
  1135. package/_mjs/Ref/DerivedAll.mjs.map +1 -0
  1136. package/_mjs/Ref/Synchronized/api.mjs +168 -0
  1137. package/_mjs/Ref/Synchronized/api.mjs.map +1 -0
  1138. package/_mjs/Ref/Synchronized/constructors.mjs +22 -0
  1139. package/_mjs/Ref/Synchronized/constructors.mjs.map +1 -0
  1140. package/_mjs/Ref/Synchronized/definition.mjs +57 -0
  1141. package/_mjs/Ref/Synchronized/definition.mjs.map +1 -0
  1142. package/_mjs/Ref/Synchronized.mjs +4 -122
  1143. package/_mjs/Ref/Synchronized.mjs.map +1 -1
  1144. package/_mjs/Ref/api/collect.mjs +18 -0
  1145. package/_mjs/Ref/api/collect.mjs.map +1 -0
  1146. package/_mjs/Ref/api/dimap.mjs +88 -0
  1147. package/_mjs/Ref/api/dimap.mjs.map +1 -0
  1148. package/_mjs/Ref/api/filter.mjs +31 -0
  1149. package/_mjs/Ref/api/filter.mjs.map +1 -0
  1150. package/_mjs/Ref/api/get.mjs +12 -0
  1151. package/_mjs/Ref/api/get.mjs.map +1 -0
  1152. package/_mjs/Ref/api/match.mjs +18 -0
  1153. package/_mjs/Ref/api/match.mjs.map +1 -0
  1154. package/_mjs/Ref/api/matchAll.mjs +16 -0
  1155. package/_mjs/Ref/api/matchAll.mjs.map +1 -0
  1156. package/_mjs/Ref/api/modify.mjs +124 -0
  1157. package/_mjs/Ref/api/modify.mjs.map +1 -0
  1158. package/_mjs/Ref/api/set.mjs +15 -0
  1159. package/_mjs/Ref/api/set.mjs.map +1 -0
  1160. package/_mjs/Ref/api.mjs +32 -0
  1161. package/_mjs/Ref/api.mjs.map +1 -0
  1162. package/_mjs/Ref/constructors.mjs +3 -18
  1163. package/_mjs/Ref/constructors.mjs.map +1 -1
  1164. package/_mjs/Ref/definition.mjs +12 -97
  1165. package/_mjs/Ref/definition.mjs.map +1 -1
  1166. package/_mjs/Ref.mjs +8 -0
  1167. package/_mjs/Ref.mjs.map +1 -1
  1168. package/_mjs/RefSubject/Atomic.mjs +100 -0
  1169. package/_mjs/RefSubject/Atomic.mjs.map +1 -0
  1170. package/_mjs/RefSubject/Synchronized/api.mjs +15 -0
  1171. package/_mjs/RefSubject/Synchronized/api.mjs.map +1 -0
  1172. package/_mjs/RefSubject/Synchronized/definition.mjs +45 -0
  1173. package/_mjs/RefSubject/Synchronized/definition.mjs.map +1 -0
  1174. package/_mjs/RefSubject/api.mjs +220 -0
  1175. package/_mjs/RefSubject/api.mjs.map +1 -0
  1176. package/_mjs/RefSubject/definition.mjs +18 -0
  1177. package/_mjs/RefSubject/definition.mjs.map +1 -0
  1178. package/_mjs/RefSubject.mjs +5 -0
  1179. package/_mjs/RefSubject.mjs.map +1 -0
  1180. package/_mjs/Reloadable/api.mjs +3 -12
  1181. package/_mjs/Reloadable/api.mjs.map +1 -1
  1182. package/_mjs/Reloadable/constructors.mjs +5 -17
  1183. package/_mjs/Reloadable/constructors.mjs.map +1 -1
  1184. package/_mjs/Reloadable/definition.mjs +2 -7
  1185. package/_mjs/Reloadable/definition.mjs.map +1 -1
  1186. package/_mjs/Reloadable.mjs.map +1 -1
  1187. package/_mjs/RuntimeConfig.mjs +0 -31
  1188. package/_mjs/RuntimeConfig.mjs.map +1 -1
  1189. package/_mjs/RuntimeFlag.mjs +2 -0
  1190. package/_mjs/RuntimeFlag.mjs.map +1 -0
  1191. package/_mjs/RuntimeFlags/Patch.mjs +58 -0
  1192. package/_mjs/RuntimeFlags/Patch.mjs.map +1 -0
  1193. package/_mjs/RuntimeFlags/RuntimeFlags.mjs +82 -0
  1194. package/_mjs/RuntimeFlags/RuntimeFlags.mjs.map +1 -0
  1195. package/_mjs/RuntimeFlags.mjs +4 -0
  1196. package/_mjs/RuntimeFlags.mjs.map +1 -0
  1197. package/_mjs/STM/api/atomically.mjs +47 -0
  1198. package/_mjs/STM/api/atomically.mjs.map +1 -0
  1199. package/_mjs/STM/api/core-api.mjs +0 -8
  1200. package/_mjs/STM/api/core-api.mjs.map +1 -1
  1201. package/_mjs/STM/api/core-constructors.mjs +0 -8
  1202. package/_mjs/STM/api/core-constructors.mjs.map +1 -1
  1203. package/_mjs/STM/api.mjs +61 -171
  1204. package/_mjs/STM/api.mjs.map +1 -1
  1205. package/_mjs/STM/definition.mjs +34 -46
  1206. package/_mjs/STM/definition.mjs.map +1 -1
  1207. package/_mjs/STM/driver.mjs +10 -52
  1208. package/_mjs/STM/driver.mjs.map +1 -1
  1209. package/_mjs/STM/internal/CommitState.mjs +5 -25
  1210. package/_mjs/STM/internal/CommitState.mjs.map +1 -1
  1211. package/_mjs/STM/internal/Entry.mjs +5 -14
  1212. package/_mjs/STM/internal/Entry.mjs.map +1 -1
  1213. package/_mjs/STM/internal/Journal.mjs +17 -99
  1214. package/_mjs/STM/internal/Journal.mjs.map +1 -1
  1215. package/_mjs/STM/internal/TryCommit.mjs +9 -10
  1216. package/_mjs/STM/internal/TryCommit.mjs.map +1 -1
  1217. package/_mjs/STM/internal/Versioned.mjs +3 -2
  1218. package/_mjs/STM/internal/Versioned.mjs.map +1 -1
  1219. package/_mjs/STM.mjs +3 -2
  1220. package/_mjs/STM.mjs.map +1 -1
  1221. package/_mjs/Schedule/Decision.mjs +6 -19
  1222. package/_mjs/Schedule/Decision.mjs.map +1 -1
  1223. package/_mjs/Schedule/Driver.mjs +0 -2
  1224. package/_mjs/Schedule/Driver.mjs.map +1 -1
  1225. package/_mjs/Schedule/api/driver.mjs +16 -16
  1226. package/_mjs/Schedule/api/driver.mjs.map +1 -1
  1227. package/_mjs/Schedule/api.mjs +100 -187
  1228. package/_mjs/Schedule/api.mjs.map +1 -1
  1229. package/_mjs/Schedule/definition.mjs +1 -0
  1230. package/_mjs/Schedule/definition.mjs.map +1 -1
  1231. package/_mjs/Schedule.mjs.map +1 -1
  1232. package/_mjs/Scope/Finalizer/definition.mjs +0 -1
  1233. package/_mjs/Scope/Finalizer/definition.mjs.map +1 -1
  1234. package/_mjs/Scope/Finalizer.mjs.map +1 -1
  1235. package/_mjs/Scope/ReleaseMap/api/releaseAll.mjs +4 -5
  1236. package/_mjs/Scope/ReleaseMap/api/releaseAll.mjs.map +1 -1
  1237. package/_mjs/Scope/ReleaseMap/api.mjs +12 -22
  1238. package/_mjs/Scope/ReleaseMap/api.mjs.map +1 -1
  1239. package/_mjs/Scope/ReleaseMap/constructors.mjs +1 -4
  1240. package/_mjs/Scope/ReleaseMap/constructors.mjs.map +1 -1
  1241. package/_mjs/Scope/ReleaseMap/definition.mjs +0 -2
  1242. package/_mjs/Scope/ReleaseMap/definition.mjs.map +1 -1
  1243. package/_mjs/Scope/ReleaseMap.mjs.map +1 -1
  1244. package/_mjs/Scope/api.mjs +1 -25
  1245. package/_mjs/Scope/api.mjs.map +1 -1
  1246. package/_mjs/Scope/definition.mjs +4 -6
  1247. package/_mjs/Scope/definition.mjs.map +1 -1
  1248. package/_mjs/Scope.mjs.map +1 -1
  1249. package/_mjs/ScopedRef/api.mjs +9 -11
  1250. package/_mjs/ScopedRef/api.mjs.map +1 -1
  1251. package/_mjs/ScopedRef/definition.mjs +3 -3
  1252. package/_mjs/ScopedRef/definition.mjs.map +1 -1
  1253. package/_mjs/ScopedRef.mjs.map +1 -1
  1254. package/_mjs/Sink/api.mjs +130 -292
  1255. package/_mjs/Sink/api.mjs.map +1 -1
  1256. package/_mjs/Sink/definition.mjs +0 -1
  1257. package/_mjs/Sink/definition.mjs.map +1 -1
  1258. package/_mjs/Sink.mjs.map +1 -1
  1259. package/_mjs/State/api.mjs +1 -8
  1260. package/_mjs/State/api.mjs.map +1 -1
  1261. package/_mjs/State/definition.mjs +6 -5
  1262. package/_mjs/State/definition.mjs.map +1 -1
  1263. package/_mjs/State/internal.mjs +5 -3
  1264. package/_mjs/State/internal.mjs.map +1 -1
  1265. package/_mjs/State.mjs.map +1 -1
  1266. package/_mjs/Stream/api/zipAllWith.mjs +2 -19
  1267. package/_mjs/Stream/api/zipAllWith.mjs.map +1 -1
  1268. package/_mjs/Stream/api/zipWith.mjs +0 -1
  1269. package/_mjs/Stream/api/zipWith.mjs.map +1 -1
  1270. package/_mjs/Stream/api/zipWithChunks.mjs +2 -14
  1271. package/_mjs/Stream/api/zipWithChunks.mjs.map +1 -1
  1272. package/_mjs/Stream/api.mjs +232 -544
  1273. package/_mjs/Stream/api.mjs.map +1 -1
  1274. package/_mjs/Stream/definition.mjs +2 -5
  1275. package/_mjs/Stream/definition.mjs.map +1 -1
  1276. package/_mjs/Stream/internal/DebounceState.mjs +9 -27
  1277. package/_mjs/Stream/internal/DebounceState.mjs.map +1 -1
  1278. package/_mjs/Stream/internal/Handoff.mjs +45 -58
  1279. package/_mjs/Stream/internal/Handoff.mjs.map +1 -1
  1280. package/_mjs/Stream/internal/Pull.mjs +10 -16
  1281. package/_mjs/Stream/internal/Pull.mjs.map +1 -1
  1282. package/_mjs/Stream/internal/SinkEndReason.mjs +11 -18
  1283. package/_mjs/Stream/internal/SinkEndReason.mjs.map +1 -1
  1284. package/_mjs/Stream/internal/Take.mjs +0 -22
  1285. package/_mjs/Stream/internal/Take.mjs.map +1 -1
  1286. package/_mjs/Stream/internal/util.mjs +0 -3
  1287. package/_mjs/Stream/internal/util.mjs.map +1 -1
  1288. package/_mjs/Stream.mjs.map +1 -1
  1289. package/_mjs/Subject/Atomic.mjs +24 -0
  1290. package/_mjs/Subject/Atomic.mjs.map +1 -0
  1291. package/_mjs/Subject/api.mjs +18 -0
  1292. package/_mjs/Subject/api.mjs.map +1 -0
  1293. package/_mjs/Subject/definition.mjs +3 -0
  1294. package/_mjs/Subject/definition.mjs.map +1 -0
  1295. package/_mjs/Subject.mjs +5 -0
  1296. package/_mjs/Subject.mjs.map +1 -0
  1297. package/_mjs/SubscriptionRef.mjs +19 -23
  1298. package/_mjs/SubscriptionRef.mjs.map +1 -1
  1299. package/_mjs/Supervisor/api.mjs +4 -15
  1300. package/_mjs/Supervisor/api.mjs.map +1 -1
  1301. package/_mjs/Supervisor/constructors.mjs +0 -12
  1302. package/_mjs/Supervisor/constructors.mjs.map +1 -1
  1303. package/_mjs/Supervisor/definition.mjs +5 -31
  1304. package/_mjs/Supervisor/definition.mjs.map +1 -1
  1305. package/_mjs/Supervisor.mjs.map +1 -1
  1306. package/_mjs/SupervisorPatch.mjs +16 -45
  1307. package/_mjs/SupervisorPatch.mjs.map +1 -1
  1308. package/_mjs/TExit/constructors.mjs +0 -6
  1309. package/_mjs/TExit/constructors.mjs.map +1 -1
  1310. package/_mjs/TExit/definition.mjs +36 -78
  1311. package/_mjs/TExit/definition.mjs.map +1 -1
  1312. package/_mjs/TExit.mjs.map +1 -1
  1313. package/_mjs/TFuture/api.mjs +0 -6
  1314. package/_mjs/TFuture/api.mjs.map +1 -1
  1315. package/_mjs/TFuture/constructors.mjs +1 -4
  1316. package/_mjs/TFuture/constructors.mjs.map +1 -1
  1317. package/_mjs/TFuture/definition.mjs.map +1 -1
  1318. package/_mjs/TFuture.mjs.map +1 -1
  1319. package/_mjs/TReentrantLock/api.mjs +17 -64
  1320. package/_mjs/TReentrantLock/api.mjs.map +1 -1
  1321. package/_mjs/TReentrantLock/definition.mjs +3 -22
  1322. package/_mjs/TReentrantLock/definition.mjs.map +1 -1
  1323. package/_mjs/TReentrantLock.mjs.map +1 -1
  1324. package/_mjs/TRef/api.mjs +20 -222
  1325. package/_mjs/TRef/api.mjs.map +1 -1
  1326. package/_mjs/TRef/constructors.mjs +1 -8
  1327. package/_mjs/TRef/constructors.mjs.map +1 -1
  1328. package/_mjs/TRef/definition.mjs +83 -19
  1329. package/_mjs/TRef/definition.mjs.map +1 -1
  1330. package/_mjs/TRef.mjs.map +1 -1
  1331. package/_mjs/TSemaphore/api.mjs +5 -15
  1332. package/_mjs/TSemaphore/api.mjs.map +1 -1
  1333. package/_mjs/TSemaphore/constructors.mjs +1 -5
  1334. package/_mjs/TSemaphore/constructors.mjs.map +1 -1
  1335. package/_mjs/TSemaphore/definition.mjs.map +1 -1
  1336. package/_mjs/TSemaphore.mjs.map +1 -1
  1337. package/_mjs/TxnId.mjs +0 -1
  1338. package/_mjs/TxnId.mjs.map +1 -1
  1339. package/_mjs/collection/immutable/Conc/dropUntilIO.mjs +0 -3
  1340. package/_mjs/collection/immutable/Conc/dropUntilIO.mjs.map +1 -1
  1341. package/_mjs/collection/immutable/Conc/dropWhileIO.mjs +0 -3
  1342. package/_mjs/collection/immutable/Conc/dropWhileIO.mjs.map +1 -1
  1343. package/_mjs/collection/immutable/Conc/filterIO.mjs +0 -3
  1344. package/_mjs/collection/immutable/Conc/filterIO.mjs.map +1 -1
  1345. package/_mjs/collection/immutable/Conc/findIO.mjs +0 -7
  1346. package/_mjs/collection/immutable/Conc/findIO.mjs.map +1 -1
  1347. package/_mjs/collection/immutable/Conc/mapIO.mjs +0 -1
  1348. package/_mjs/collection/immutable/Conc/mapIO.mjs.map +1 -1
  1349. package/_mjs/collection/immutable/Conc/takeWhileIO.mjs +0 -4
  1350. package/_mjs/collection/immutable/Conc/takeWhileIO.mjs.map +1 -1
  1351. package/_mjs/collection/immutable/Conc.mjs.map +1 -1
  1352. package/_mjs/data/Exit/foreachIO.mjs +0 -1
  1353. package/_mjs/data/Exit/foreachIO.mjs.map +1 -1
  1354. package/_mjs/internal/HashedPair.mjs +4 -7
  1355. package/_mjs/internal/HashedPair.mjs.map +1 -1
  1356. package/_mjs/internal/Hub.mjs +0 -147
  1357. package/_mjs/internal/Hub.mjs.map +1 -1
  1358. package/_mjs/internal/IsFatal.mjs +15 -42
  1359. package/_mjs/internal/IsFatal.mjs.map +1 -1
  1360. package/_mjs/internal/MutableQueue.mjs +0 -49
  1361. package/_mjs/internal/MutableQueue.mjs.map +1 -1
  1362. package/_mjs/internal/Scheduler.mjs +0 -11
  1363. package/_mjs/internal/Scheduler.mjs.map +1 -1
  1364. package/_mjs/internal/StackTraceBuilder.mjs +0 -3
  1365. package/_mjs/internal/StackTraceBuilder.mjs.map +1 -1
  1366. package/_src/Cached/definition.ts +6 -4
  1367. package/_src/Cached/internal.ts +4 -4
  1368. package/_src/Channel/api/{mapOutIOC.ts → mapOutConcurrentIO.ts} +8 -5
  1369. package/_src/Channel/api/mergeAllWith.ts +6 -6
  1370. package/_src/Channel/api/mergeWith.ts +5 -5
  1371. package/_src/Channel/api/{zipC.ts → zipConcurrent.ts} +10 -10
  1372. package/_src/Channel/api.ts +31 -32
  1373. package/_src/Channel/core-api.ts +4 -4
  1374. package/_src/Channel/definition.ts +37 -14
  1375. package/_src/Channel/internal/ChannelExecutor.ts +25 -14
  1376. package/_src/Channel/internal/MergeDecision.ts +11 -6
  1377. package/_src/Channel/internal/SingleProducerAsyncInput.ts +1 -1
  1378. package/_src/CountdownLatch.ts +39 -0
  1379. package/_src/Differ/definition.ts +2 -4
  1380. package/_src/Fiber/FiberMessage.ts +78 -0
  1381. package/_src/Fiber/FiberRuntime.ts +826 -0
  1382. package/_src/Fiber/api/awaitAll.ts +1 -1
  1383. package/_src/Fiber/api/collectAll.ts +3 -2
  1384. package/_src/Fiber/api/inheritRefs.ts +1 -1
  1385. package/_src/Fiber/api/interrupt.ts +1 -2
  1386. package/_src/Fiber/api/interruptAs.ts +11 -6
  1387. package/_src/Fiber/api/interruptFork.ts +1 -1
  1388. package/_src/Fiber/api/location.ts +2 -2
  1389. package/_src/Fiber/api/zipWith.ts +1 -1
  1390. package/_src/Fiber/definition.ts +44 -22
  1391. package/_src/Fiber.ts +2 -4
  1392. package/_src/FiberDescriptor.ts +1 -8
  1393. package/_src/FiberRef/api.ts +13 -17
  1394. package/_src/FiberRef/definition.ts +9 -4
  1395. package/_src/FiberRef/unsafe.ts +6 -1
  1396. package/_src/FiberRefs/api.ts +56 -3
  1397. package/_src/FiberRefs/definition.ts +15 -7
  1398. package/_src/FiberRefs/join.ts +5 -5
  1399. package/_src/FiberScope/constructors.ts +2 -2
  1400. package/_src/FiberScope/definition.ts +21 -9
  1401. package/_src/FiberStatus/constructors.ts +6 -18
  1402. package/_src/FiberStatus/definition.ts +13 -54
  1403. package/_src/Future/api.ts +14 -5
  1404. package/_src/Hub/api.ts +451 -0
  1405. package/_src/Hub/definition.ts +117 -93
  1406. package/_src/Hub/internal.ts +165 -115
  1407. package/_src/Hub.ts +1 -1
  1408. package/_src/IO/api/asyncInterrupt.ts +77 -0
  1409. package/_src/IO/api/core-scope.ts +70 -89
  1410. package/_src/IO/api/delay.ts +8 -0
  1411. package/_src/IO/api/{foreachC.ts → foreachConcurrent.ts} +8 -8
  1412. package/_src/IO/api/foreachExec.ts +2 -2
  1413. package/_src/IO/api/fork.ts +83 -0
  1414. package/_src/IO/api/interrupt.ts +106 -69
  1415. package/_src/IO/api/onTermination.ts +8 -7
  1416. package/_src/IO/api/race.ts +4 -4
  1417. package/_src/IO/api/sequenceT.ts +4 -6
  1418. package/_src/IO/api/supervised.ts +7 -9
  1419. package/_src/IO/api/withChildren.ts +2 -4
  1420. package/_src/IO/api/{zipC.ts → zipConcurrent.ts} +9 -9
  1421. package/_src/IO/api.ts +99 -256
  1422. package/_src/IO/definition.ts +171 -161
  1423. package/_src/IO/runtime.ts +62 -61
  1424. package/_src/IO.ts +6 -4
  1425. package/_src/Layer/MemoMap.ts +3 -3
  1426. package/_src/Layer/api.ts +2 -2
  1427. package/_src/Layer/definition.ts +18 -13
  1428. package/_src/Logger/definition.ts +9 -4
  1429. package/_src/MVar/api.ts +185 -0
  1430. package/_src/MVar/definition.ts +45 -0
  1431. package/_src/MVar.ts +4 -0
  1432. package/_src/Push/api.ts +705 -0
  1433. package/_src/Push/definition.ts +51 -0
  1434. package/_src/Push/internal.ts +39 -0
  1435. package/_src/Push.ts +5 -0
  1436. package/_src/Queue/api/dimapIO.ts +218 -0
  1437. package/_src/Queue/api/filterInputIO.ts +122 -0
  1438. package/_src/Queue/api/filterOutputIO.ts +138 -0
  1439. package/_src/Queue/api/operations.ts +141 -0
  1440. package/_src/Queue/api/poll.ts +16 -0
  1441. package/_src/Queue/api/takeBetween.ts +44 -0
  1442. package/_src/Queue/api/zipWithIO.ts +110 -0
  1443. package/_src/Queue/api.ts +9 -0
  1444. package/_src/Queue/constructors.ts +6 -22
  1445. package/_src/Queue/definition.ts +196 -215
  1446. package/_src/Queue/internal.ts +159 -2
  1447. package/_src/Queue/strategy.ts +3 -3
  1448. package/_src/Queue.ts +3 -1
  1449. package/_src/Ref/Atomic.ts +43 -10
  1450. package/_src/Ref/Derived.ts +95 -0
  1451. package/_src/Ref/DerivedAll.ts +99 -0
  1452. package/_src/Ref/Synchronized/api.ts +248 -0
  1453. package/_src/Ref/Synchronized/constructors.ts +21 -0
  1454. package/_src/Ref/Synchronized/definition.ts +136 -0
  1455. package/_src/Ref/Synchronized.ts +5 -107
  1456. package/_src/Ref/api/collect.ts +17 -0
  1457. package/_src/Ref/api/dimap.ts +102 -0
  1458. package/_src/Ref/api/filter.ts +31 -0
  1459. package/_src/Ref/api/get.ts +14 -0
  1460. package/_src/Ref/api/match.ts +25 -0
  1461. package/_src/Ref/api/matchAll.ts +24 -0
  1462. package/_src/Ref/api/modify.ts +133 -0
  1463. package/_src/Ref/api/set.ts +17 -0
  1464. package/_src/Ref/api.ts +39 -0
  1465. package/_src/Ref/constructors.ts +2 -15
  1466. package/_src/Ref/definition.ts +124 -81
  1467. package/_src/Ref.ts +9 -0
  1468. package/_src/RefSubject/Atomic.ts +120 -0
  1469. package/_src/RefSubject/Synchronized/api.ts +14 -0
  1470. package/_src/RefSubject/Synchronized/definition.ts +72 -0
  1471. package/_src/RefSubject/api.ts +240 -0
  1472. package/_src/RefSubject/definition.ts +69 -0
  1473. package/_src/RefSubject.ts +5 -0
  1474. package/_src/Reloadable/definition.ts +6 -1
  1475. package/_src/RuntimeConfig.ts +0 -29
  1476. package/_src/RuntimeFlag.ts +10 -0
  1477. package/_src/RuntimeFlags/Patch.ts +79 -0
  1478. package/_src/RuntimeFlags/RuntimeFlags.ts +112 -0
  1479. package/_src/RuntimeFlags.ts +4 -0
  1480. package/_src/STM/api/atomically.ts +43 -0
  1481. package/_src/STM/api.ts +20 -38
  1482. package/_src/STM/definition.ts +33 -20
  1483. package/_src/STM/driver.ts +3 -3
  1484. package/_src/STM/internal/Entry.ts +2 -2
  1485. package/_src/STM/internal/Journal.ts +1 -1
  1486. package/_src/STM/internal/TryCommit.ts +4 -4
  1487. package/_src/STM/internal/Versioned.ts +1 -1
  1488. package/_src/STM.ts +1 -0
  1489. package/_src/Schedule/api/driver.ts +2 -2
  1490. package/_src/Schedule/api.ts +60 -38
  1491. package/_src/Schedule/definition.ts +8 -3
  1492. package/_src/Scope/ReleaseMap/api/releaseAll.ts +4 -3
  1493. package/_src/Scope/ReleaseMap/constructors.ts +1 -1
  1494. package/_src/Scope/definition.ts +2 -2
  1495. package/_src/ScopedRef/definition.ts +1 -1
  1496. package/_src/Sink/api.ts +15 -12
  1497. package/_src/State/api.ts +1 -1
  1498. package/_src/State/definition.ts +6 -3
  1499. package/_src/State/internal.ts +8 -3
  1500. package/_src/Stream/api/zipAllWith.ts +1 -1
  1501. package/_src/Stream/api/zipWithChunks.ts +1 -1
  1502. package/_src/Stream/api.ts +91 -81
  1503. package/_src/Stream/definition.ts +17 -5
  1504. package/_src/Stream/internal/Handoff.ts +34 -27
  1505. package/_src/Stream/internal/Pull.ts +2 -1
  1506. package/_src/Stream/internal/SinkEndReason.ts +2 -2
  1507. package/_src/Subject/Atomic.ts +32 -0
  1508. package/_src/Subject/api.ts +18 -0
  1509. package/_src/Subject/definition.ts +18 -0
  1510. package/_src/Subject.ts +5 -0
  1511. package/_src/SubscriptionRef.ts +21 -7
  1512. package/_src/Supervisor/api.ts +2 -2
  1513. package/_src/SupervisorPatch.ts +1 -1
  1514. package/_src/TExit/definition.ts +11 -12
  1515. package/_src/TFuture/definition.ts +2 -2
  1516. package/_src/TReentrantLock/api.ts +4 -4
  1517. package/_src/TReentrantLock/definition.ts +1 -1
  1518. package/_src/TRef/api.ts +32 -200
  1519. package/_src/TRef/constructors.ts +6 -6
  1520. package/_src/TRef/definition.ts +171 -39
  1521. package/_src/TSemaphore/api.ts +1 -1
  1522. package/_src/TSemaphore/definition.ts +1 -1
  1523. package/_src/global.ts +13 -5
  1524. package/_src/index.ts +7 -1
  1525. package/_src/internal/IsFatal.ts +1 -1
  1526. package/global.d.ts +13 -5
  1527. package/index.d.ts +7 -1
  1528. package/internal/HashedPair.d.ts +2 -2
  1529. package/internal/IsFatal.d.ts +1 -1
  1530. package/package.json +4 -4
  1531. package/Channel/api/mapOutIOC.d.ts +0 -8
  1532. package/Channel/api/zipC.d.ts +0 -16
  1533. package/Fiber/FiberContext.d.ts +0 -153
  1534. package/Fiber/api/evalOn.d.ts +0 -7
  1535. package/Fiber/api/evalOnIO.d.ts +0 -9
  1536. package/Fiber/api/interruptAsFork.d.ts +0 -8
  1537. package/FiberState/api.d.ts +0 -7
  1538. package/FiberState/constructors.d.ts +0 -22
  1539. package/FiberState/definition.d.ts +0 -38
  1540. package/FiberState.d.ts +0 -3
  1541. package/Hub/constructors.d.ts +0 -49
  1542. package/IO/api/onExit.d.ts +0 -7
  1543. package/IO/api/withRuntimeConfig.d.ts +0 -10
  1544. package/IO/api/zipC.d.ts +0 -13
  1545. package/_cjs/Channel/api/mapOutIOC.cjs +0 -63
  1546. package/_cjs/Channel/api/mapOutIOC.cjs.map +0 -1
  1547. package/_cjs/Channel/api/zipC.cjs.map +0 -1
  1548. package/_cjs/Fiber/FiberContext.cjs +0 -1088
  1549. package/_cjs/Fiber/FiberContext.cjs.map +0 -1
  1550. package/_cjs/Fiber/api/evalOn.cjs.map +0 -1
  1551. package/_cjs/Fiber/api/evalOnIO.cjs.map +0 -1
  1552. package/_cjs/Fiber/api/interruptAsFork.cjs +0 -17
  1553. package/_cjs/Fiber/api/interruptAsFork.cjs.map +0 -1
  1554. package/_cjs/FiberState/api.cjs.map +0 -1
  1555. package/_cjs/FiberState/constructors.cjs.map +0 -1
  1556. package/_cjs/FiberState/definition.cjs +0 -46
  1557. package/_cjs/FiberState/definition.cjs.map +0 -1
  1558. package/_cjs/FiberState.cjs.map +0 -1
  1559. package/_cjs/Hub/constructors.cjs +0 -93
  1560. package/_cjs/Hub/constructors.cjs.map +0 -1
  1561. package/_cjs/IO/api/foreachC.cjs.map +0 -1
  1562. package/_cjs/IO/api/onExit.cjs.map +0 -1
  1563. package/_cjs/IO/api/withRuntimeConfig.cjs.map +0 -1
  1564. package/_cjs/IO/api/zipC.cjs.map +0 -1
  1565. package/_mjs/Channel/api/mapOutIOC.mjs +0 -33
  1566. package/_mjs/Channel/api/mapOutIOC.mjs.map +0 -1
  1567. package/_mjs/Channel/api/zipC.mjs +0 -36
  1568. package/_mjs/Channel/api/zipC.mjs.map +0 -1
  1569. package/_mjs/Fiber/FiberContext.mjs +0 -1013
  1570. package/_mjs/Fiber/FiberContext.mjs.map +0 -1
  1571. package/_mjs/Fiber/api/evalOn.mjs +0 -19
  1572. package/_mjs/Fiber/api/evalOn.mjs.map +0 -1
  1573. package/_mjs/Fiber/api/evalOnIO.mjs +0 -18
  1574. package/_mjs/Fiber/api/evalOnIO.mjs.map +0 -1
  1575. package/_mjs/Fiber/api/interruptAsFork.mjs +0 -10
  1576. package/_mjs/Fiber/api/interruptAsFork.mjs.map +0 -1
  1577. package/_mjs/FiberState/api.mjs +0 -15
  1578. package/_mjs/FiberState/api.mjs.map +0 -1
  1579. package/_mjs/FiberState/constructors.mjs +0 -26
  1580. package/_mjs/FiberState/constructors.mjs.map +0 -1
  1581. package/_mjs/FiberState/definition.mjs +0 -26
  1582. package/_mjs/FiberState/definition.mjs.map +0 -1
  1583. package/_mjs/FiberState.mjs +0 -5
  1584. package/_mjs/FiberState.mjs.map +0 -1
  1585. package/_mjs/Hub/constructors.mjs +0 -66
  1586. package/_mjs/Hub/constructors.mjs.map +0 -1
  1587. package/_mjs/IO/api/foreachC.mjs.map +0 -1
  1588. package/_mjs/IO/api/onExit.mjs +0 -12
  1589. package/_mjs/IO/api/onExit.mjs.map +0 -1
  1590. package/_mjs/IO/api/withRuntimeConfig.mjs +0 -15
  1591. package/_mjs/IO/api/withRuntimeConfig.mjs.map +0 -1
  1592. package/_mjs/IO/api/zipC.mjs +0 -43
  1593. package/_mjs/IO/api/zipC.mjs.map +0 -1
  1594. package/_src/Fiber/FiberContext.ts +0 -999
  1595. package/_src/Fiber/api/evalOn.ts +0 -14
  1596. package/_src/Fiber/api/evalOnIO.ts +0 -16
  1597. package/_src/Fiber/api/interruptAsFork.ts +0 -9
  1598. package/_src/FiberState/api.ts +0 -12
  1599. package/_src/FiberState/constructors.ts +0 -33
  1600. package/_src/FiberState/definition.ts +0 -43
  1601. package/_src/FiberState.ts +0 -5
  1602. package/_src/Hub/constructors.ts +0 -80
  1603. package/_src/IO/api/onExit.ts +0 -11
  1604. package/_src/IO/api/withRuntimeConfig.ts +0 -18
@@ -0,0 +1,826 @@
1
+ import type { FiberStatus } from "../FiberStatus.js";
2
+ import type { OnFailure, OnSuccess, OnSuccessAndFailure, UIO } from "../IO/definition.js";
3
+ import type { RuntimeFlags } from "../RuntimeFlags.js";
4
+
5
+ import { Trace } from "@fncts/base/data/Trace";
6
+ import { FiberTypeId, FiberVariance } from "@fncts/io/Fiber/definition";
7
+ import { StackTraceBuilder } from "@fncts/io/internal/StackTraceBuilder";
8
+
9
+ import { Done, Suspended } from "../FiberStatus.js";
10
+ import { Running } from "../FiberStatus.js";
11
+ import { FiberStatusTag } from "../FiberStatus.js";
12
+ import { LinkedQueue } from "../internal/MutableQueue.js";
13
+ import { isIO } from "../IO/definition.js";
14
+ import { WhileLoop } from "../IO/definition.js";
15
+ import { IOOpCode } from "../IO/definition.js";
16
+ import { isIOError } from "../IO/definition.js";
17
+ import { RuntimeFlag } from "../RuntimeFlag.js";
18
+ import { FiberMessage, FiberMessageTag } from "./FiberMessage.js";
19
+
20
+ export class RevertFlags {
21
+ readonly ioOpCode = IOOpCode.RevertFlags;
22
+ constructor(readonly patch: RuntimeFlags.Patch, readonly trace?: string) {}
23
+ }
24
+
25
+ export class UpdateTrace {
26
+ readonly ioOpCode = IOOpCode.UpdateTrace;
27
+ constructor(readonly trace?: string) {}
28
+ }
29
+
30
+ export type Continuation =
31
+ | OnSuccess<any, any, any, any, any, any>
32
+ | OnSuccessAndFailure<any, any, any, any, any, any, any, any, any>
33
+ | OnFailure<any, any, any, any, any, any>
34
+ | WhileLoop<any, any, any>
35
+ | UpdateTrace
36
+ | RevertFlags;
37
+
38
+ /**
39
+ * @tsplus type fncts.io.Fiber
40
+ */
41
+ export class FiberRuntime<E, A> implements Fiber.Runtime<E, A> {
42
+ readonly [FiberTypeId]: FiberTypeId = FiberTypeId;
43
+ declare [FiberVariance]: {
44
+ readonly _E: (_: never) => E;
45
+ readonly _A: (_: never) => A;
46
+ };
47
+ readonly _tag = "RuntimeFiber";
48
+
49
+ constructor(readonly fiberId: FiberId.Runtime, fiberRefs0: FiberRefs, readonly runtimeFlags0: RuntimeFlags) {
50
+ this._fiberRefs = fiberRefs0;
51
+ this._runtimeFlags = runtimeFlags0;
52
+ }
53
+
54
+ private _fiberRefs: FiberRefs;
55
+ private _runtimeFlags: RuntimeFlags;
56
+ private queue = new LinkedQueue<FiberMessage>();
57
+ private _children = null! as Set<FiberRuntime<any, any>>;
58
+ private observers = List<(_: Exit<E, A>) => void>();
59
+ private running = false;
60
+ private stack = new Stack<Continuation>();
61
+ private asyncInterruptor = null! as (_: IO<any, any, any>) => any;
62
+ private asyncTrace = null! as string;
63
+ private asyncBlockinOn = null! as FiberId;
64
+ private _exitValue = null! as Exit<E, A>;
65
+
66
+ get id(): FiberId.Runtime {
67
+ return this.fiberId;
68
+ }
69
+
70
+ ask<A>(f: (fiberRuntime: FiberRuntime<any, any>, status: FiberStatus) => A): UIO<A> {
71
+ return IO.defer(() => {
72
+ const future = Future.unsafeMake<never, A>(this.fiberId);
73
+
74
+ this.tell(FiberMessage.Stateful((fiber, status) => future.unsafeDone(IO.succeed(f(fiber, status)))));
75
+
76
+ return future.await;
77
+ });
78
+ }
79
+
80
+ get await(): UIO<Exit<E, A>> {
81
+ return IO.async<never, never, Exit<E, A>>(
82
+ (cb) =>
83
+ this.tell(
84
+ FiberMessage.Stateful((fiber, _) => {
85
+ if (fiber._exitValue !== null) cb(IO.succeedNow(fiber.exitValue()));
86
+ else fiber.addObserver((exit) => cb(IO.succeedNow(exit)));
87
+ }),
88
+ ),
89
+ this.id,
90
+ );
91
+ }
92
+
93
+ get children(): UIO<Conc<FiberRuntime<any, any>>> {
94
+ return this.ask((fiber) => Conc.from(fiber.getChildren()));
95
+ }
96
+
97
+ get fiberRefs(): UIO<FiberRefs> {
98
+ return this.ask((fiber) => fiber.getFiberRefs());
99
+ }
100
+
101
+ get inheritAll(): UIO<void> {
102
+ return IO.withFiberRuntime((parentFiber, parentStatus) => {
103
+ const parentFiberId = parentFiber.id;
104
+ const parentFiberRefs = parentFiber.getFiberRefs();
105
+ const parentRuntimeFlags = parentStatus.runtimeFlags;
106
+
107
+ const childFiberRefs = this.getFiberRefs();
108
+ const updatedFiberRefs = parentFiberRefs.join(parentFiberId, childFiberRefs);
109
+
110
+ parentFiber.setFiberRefs(updatedFiberRefs);
111
+
112
+ return this.runtimeFlags.flatMap((childRuntimeFlags) => {
113
+ const patch = parentRuntimeFlags
114
+ .diff(childRuntimeFlags)
115
+ .exclude(RuntimeFlag.WindDown)
116
+ .exclude(RuntimeFlag.Interruption);
117
+
118
+ return IO.updateRuntimeFlags(patch);
119
+ });
120
+ });
121
+ }
122
+
123
+ get runtimeFlags(): UIO<RuntimeFlags> {
124
+ return this.ask((state, status) => {
125
+ if (status._tag === FiberStatusTag.Done) return state._runtimeFlags;
126
+ else return status.runtimeFlags;
127
+ });
128
+ }
129
+
130
+ interruptAsFork(fiberId: FiberId): UIO<void> {
131
+ return IO.succeed(() => {
132
+ const cause = Cause.interrupt(fiberId);
133
+ this.tell(FiberMessage.InterruptSignal(cause));
134
+ });
135
+ }
136
+
137
+ getSupervisor(): Supervisor<any> {
138
+ return this.getFiberRef(FiberRef.currentSupervisor);
139
+ }
140
+
141
+ get poll(): UIO<Maybe<Exit<E, A>>> {
142
+ return IO.succeed(Maybe.fromNullable(this.exitValue()));
143
+ }
144
+
145
+ private run(): void {
146
+ this.drainQueueOnCurrentThread();
147
+ }
148
+
149
+ private drainQueueOnCurrentThread(): void {
150
+ // assert(this.running, "Invalid state in FiberRuntime: Fiber is not running");
151
+
152
+ let recurse = true;
153
+
154
+ while (recurse) {
155
+ let evaluationSignal = EvaluationSignal.Continue;
156
+ if (this._runtimeFlags.currentFiber) {
157
+ // TODO
158
+ }
159
+ try {
160
+ while (evaluationSignal === EvaluationSignal.Continue) {
161
+ evaluationSignal = this.queue.isEmpty
162
+ ? EvaluationSignal.Done
163
+ : this.evaluateMessageWhileSuspended(this.queue.dequeue(null!));
164
+ }
165
+ } finally {
166
+ this.running = false;
167
+ if (this._runtimeFlags.currentFiber) {
168
+ // TODO
169
+ }
170
+ }
171
+
172
+ if (!this.queue.isEmpty && !this.running) {
173
+ this.running = true;
174
+ if (evaluationSignal === EvaluationSignal.YieldNow) {
175
+ this.drainQueueLaterOnExecutor();
176
+ recurse = false;
177
+ } else {
178
+ recurse = true;
179
+ }
180
+ } else {
181
+ recurse = false;
182
+ }
183
+ }
184
+ }
185
+
186
+ private drainQueueLaterOnExecutor(): void {
187
+ // assert(this.running, "Invalid state in FiberRuntime: Fiber is not running");
188
+
189
+ this.getFiberRef(FiberRef.currentScheduler).scheduleTask(() => this.run());
190
+ }
191
+
192
+ private drainQueueWhileRunning(
193
+ runtimeFlags: RuntimeFlags,
194
+ lastTrace: string,
195
+ cur0: IO<any, any, any>,
196
+ ): IO<any, any, any> {
197
+ let cur = cur0;
198
+
199
+ while (!this.queue.isEmpty) {
200
+ const message = this.queue.dequeue(null!);
201
+
202
+ switch (message._tag) {
203
+ case FiberMessageTag.InterruptSignal: {
204
+ this.processNewInterruptSignal(message.cause);
205
+ cur = runtimeFlags.interruptible ? IO.failCause(message.cause) : cur;
206
+ break;
207
+ }
208
+ case FiberMessageTag.GenStackTrace: {
209
+ const oldCur = cur;
210
+ cur = IO.stackTrace(undefined).flatMap((stackTrace) => {
211
+ message.onTrace(stackTrace);
212
+ return oldCur;
213
+ }, undefined);
214
+ break;
215
+ }
216
+ case FiberMessageTag.Stateful: {
217
+ message.onFiber(this, new Running(runtimeFlags, lastTrace));
218
+ break;
219
+ }
220
+ case FiberMessageTag.Resume: {
221
+ throw new IllegalStateError("It is illegal to have multiple concurrent run loops in a single fiber");
222
+ }
223
+ case FiberMessageTag.YieldNow: {
224
+ const oldCur = cur;
225
+ cur = IO.yieldNow.flatMap(() => oldCur, undefined);
226
+ break;
227
+ }
228
+ }
229
+ }
230
+
231
+ return cur;
232
+ }
233
+
234
+ private evaluateEffect(effect0: IO<any, any, any>) {
235
+ // assert(this.running, "Invalid state in FiberRuntime: Fiber is not running");
236
+
237
+ this.getSupervisor().unsafeOnResume(this);
238
+
239
+ try {
240
+ let effect: IO<any, any, any>;
241
+
242
+ if (this._runtimeFlags.interruptible && this.isInterrupted()) {
243
+ effect = IO.failCause(this.getInterruptedCause());
244
+ } else {
245
+ effect = effect0;
246
+ }
247
+
248
+ let finalExit = null! as Exit<E, A>;
249
+
250
+ while (effect !== null) {
251
+ try {
252
+ const exit = this.runLoop(effect);
253
+ this._runtimeFlags = this._runtimeFlags.enable(RuntimeFlag.WindDown);
254
+ const interruption = this.interruptAllChildren();
255
+
256
+ if (interruption === null) {
257
+ if (this.queue.isEmpty) {
258
+ finalExit = exit;
259
+ this.setExitValue(exit);
260
+ } else {
261
+ this.tell(FiberMessage.Resume(IO.fromExitNow(exit)));
262
+ }
263
+
264
+ effect = null!;
265
+ } else {
266
+ effect = interruption.flatMap(() => IO.fromExitNow(exit), this.id.location);
267
+ }
268
+ } catch (e) {
269
+ if (isIO(e)) {
270
+ if (IO.concrete(e).ioOpCode === IOOpCode.YieldNow) {
271
+ if (this._runtimeFlags.cooperativeYielding) {
272
+ this.tell(FiberMessage.YieldNow);
273
+ this.tell(FiberMessage.Resume(IO.unit));
274
+ effect = null!;
275
+ } else {
276
+ effect = IO.unit;
277
+ }
278
+ } else if (IO.concrete(e).ioOpCode === IOOpCode.Async) {
279
+ effect = null!;
280
+ } else {
281
+ throw new Error(`Unhandled op ${IO.concrete(e).ioOpCode}`);
282
+ }
283
+ } else {
284
+ throw e;
285
+ }
286
+ }
287
+ }
288
+ } finally {
289
+ this.getSupervisor().unsafeOnSuspend(this);
290
+ }
291
+ }
292
+
293
+ runLoop(effect: IO<any, any, any>): Exit<any, any> {
294
+ // assert(this.running, "Invalid state in FiberRuntime: Fiber is not running");
295
+
296
+ let cur = IO.concrete(effect);
297
+ let lastTrace = undefined! as string;
298
+ let ops = 0;
299
+
300
+ while (true) {
301
+ if (this._runtimeFlags.opSupervision) {
302
+ this.getSupervisor().unsafeOnEffect(this, cur);
303
+ }
304
+ const nextTrace = IO.concrete(cur).trace;
305
+ if (nextTrace !== undefined) lastTrace = nextTrace;
306
+
307
+ cur = IO.concrete(this.drainQueueWhileRunning(this._runtimeFlags, lastTrace, cur));
308
+
309
+ ops += 1;
310
+
311
+ if (ops > 2048) {
312
+ ops = 0;
313
+ const oldCur = cur;
314
+ const trace = lastTrace;
315
+ cur = IO.concrete(IO.yieldNow.flatMap(() => oldCur, trace));
316
+ }
317
+ try {
318
+ switch (cur.ioOpCode) {
319
+ case IOOpCode.Sync: {
320
+ const value = cur.evaluate();
321
+ const cont = this.getNextSuccessCont();
322
+ if (cont) {
323
+ switch (cont.ioOpCode) {
324
+ case IOOpCode.OnSuccess:
325
+ case IOOpCode.OnSuccessAndFailure: {
326
+ cur = IO.concrete(cont.successK(value));
327
+ break;
328
+ }
329
+ case IOOpCode.WhileLoop: {
330
+ cont.process(value);
331
+ if (cont.check()) {
332
+ this.stack.push(cont);
333
+ cur = IO.concrete(cont.body());
334
+ } else {
335
+ cur = IO.concrete(IO.unit);
336
+ }
337
+ break;
338
+ }
339
+ case IOOpCode.RevertFlags: {
340
+ this.patchRuntimeFlags(this._runtimeFlags, cont.patch);
341
+ if (this._runtimeFlags.interruptible && this.isInterrupted()) {
342
+ cur = IO.concrete(IO.failCauseNow(this.getInterruptedCause()));
343
+ } else {
344
+ cur = IO.concrete(IO.succeedNow(value));
345
+ }
346
+ break;
347
+ }
348
+ case IOOpCode.UpdateTrace: {
349
+ if (cont.trace !== undefined) lastTrace = cont.trace;
350
+ cur = IO.concrete(IO.unit);
351
+ break;
352
+ }
353
+ }
354
+ } else {
355
+ return Exit.succeed(value);
356
+ }
357
+ break;
358
+ }
359
+ case IOOpCode.OnSuccessAndFailure:
360
+ case IOOpCode.OnFailure:
361
+ case IOOpCode.OnSuccess: {
362
+ this.stack.push(cur);
363
+ cur = IO.concrete(cur.first);
364
+ break;
365
+ }
366
+ case IOOpCode.Async: {
367
+ this.asyncTrace = lastTrace;
368
+ this.asyncBlockinOn = cur.blockingOn();
369
+ this.initiateAsync(this._runtimeFlags, cur.registerCallback);
370
+ throw cur;
371
+ }
372
+ case IOOpCode.UpdateRuntimeFlagsWithin: {
373
+ const updateFlags = cur.update;
374
+ const oldRuntimeFlags = this._runtimeFlags;
375
+ const newRuntimeFlags = updateFlags.patch(oldRuntimeFlags);
376
+
377
+ if (newRuntimeFlags === oldRuntimeFlags) {
378
+ cur = IO.concrete(cur.scope(oldRuntimeFlags));
379
+ } else {
380
+ if (newRuntimeFlags.interruptible && this.isInterrupted()) {
381
+ cur = IO.concrete(IO.failCauseNow(this.getInterruptedCause()));
382
+ } else {
383
+ this.patchRuntimeFlags(this._runtimeFlags, updateFlags);
384
+ const revertFlags = newRuntimeFlags.diff(oldRuntimeFlags);
385
+ this.stack.push(new RevertFlags(revertFlags));
386
+ cur = IO.concrete(cur.scope(oldRuntimeFlags));
387
+ }
388
+ }
389
+ break;
390
+ }
391
+ case IOOpCode.GenerateStackTrace: {
392
+ cur = IO.concrete(IO.succeedNow(this.generateStackTrace()));
393
+ break;
394
+ }
395
+ case IOOpCode.Stateful: {
396
+ cur = IO.concrete(cur.onState(this, new Running(this._runtimeFlags, lastTrace)));
397
+ break;
398
+ }
399
+ case IOOpCode.SucceedNow: {
400
+ const oldCur = cur;
401
+ const cont = this.getNextSuccessCont();
402
+ if (cont) {
403
+ switch (cont.ioOpCode) {
404
+ case IOOpCode.OnSuccess:
405
+ case IOOpCode.OnSuccessAndFailure: {
406
+ cur = IO.concrete(cont.successK(oldCur.value));
407
+ break;
408
+ }
409
+ case IOOpCode.WhileLoop: {
410
+ cont.process(oldCur.value);
411
+ if (cont.check()) {
412
+ this.stack.push(cont);
413
+ cur = IO.concrete(cont.body());
414
+ } else {
415
+ cur = IO.concrete(IO.unit);
416
+ }
417
+ break;
418
+ }
419
+ case IOOpCode.RevertFlags: {
420
+ this.patchRuntimeFlags(this._runtimeFlags, cont.patch);
421
+ if (this._runtimeFlags.interruptible && this.isInterrupted()) {
422
+ cur = IO.concrete(IO.failCauseNow(this.getInterruptedCause()));
423
+ }
424
+ break;
425
+ }
426
+ case IOOpCode.UpdateTrace: {
427
+ if (cont.trace !== undefined) lastTrace = cont.trace;
428
+ cur = IO.concrete(IO.unit);
429
+ break;
430
+ }
431
+ }
432
+ } else {
433
+ return Exit.succeed(oldCur.value);
434
+ }
435
+ break;
436
+ }
437
+ case IOOpCode.Fail: {
438
+ const cause = cur.cause();
439
+ const cont = this.getNextFailCont();
440
+ if (cont) {
441
+ switch (cont.ioOpCode) {
442
+ case IOOpCode.OnFailure:
443
+ case IOOpCode.OnSuccessAndFailure: {
444
+ if (!(this._runtimeFlags.interruptible && this.isInterrupted())) {
445
+ cur = IO.concrete(cont.failureK(cause));
446
+ } else {
447
+ cur = IO.concrete(IO.failCauseNow(cause.stripFailures));
448
+ }
449
+ break;
450
+ }
451
+ case IOOpCode.RevertFlags: {
452
+ this.patchRuntimeFlags(this._runtimeFlags, cont.patch);
453
+ if (this._runtimeFlags.interruptible && this.isInterrupted()) {
454
+ const interruptedCause = this.getInterruptedCause();
455
+ if (cause.contains(interruptedCause)) {
456
+ cur = IO.concrete(IO.failCauseNow(cause));
457
+ } else {
458
+ cur = IO.concrete(IO.failCauseNow(Cause.then(cause, this.getInterruptedCause())));
459
+ }
460
+ }
461
+ break;
462
+ }
463
+ case IOOpCode.UpdateTrace: {
464
+ if (cont.trace !== undefined) lastTrace = cont.trace;
465
+ cur = IO.concrete(IO.unit);
466
+ break;
467
+ }
468
+ }
469
+ } else {
470
+ return Exit.failCause(cause);
471
+ }
472
+ break;
473
+ }
474
+ case IOOpCode.UpdateRuntimeFlags: {
475
+ this.patchRuntimeFlags(this._runtimeFlags, cur.update);
476
+ cur = IO.concrete(IO.unit);
477
+ break;
478
+ }
479
+ case IOOpCode.WhileLoop: {
480
+ const iterate = cur;
481
+ const check = iterate.check;
482
+ const body = iterate.body;
483
+ if (check()) {
484
+ cur = IO.concrete(body());
485
+ this.stack.push(iterate);
486
+ } else {
487
+ cur = IO.concrete(IO.unit);
488
+ }
489
+ break;
490
+ }
491
+ case IOOpCode.YieldNow: {
492
+ throw cur;
493
+ }
494
+ case IOOpCode.Commit: {
495
+ cur = IO.concrete(cur.commit);
496
+ }
497
+ }
498
+ } catch (e) {
499
+ if (isIOError(e)) {
500
+ cur = IO.concrete(IO.failCauseNow(e.cause));
501
+ } else if (
502
+ isIO(e) &&
503
+ (IO.concrete(e).ioOpCode === IOOpCode.Async || IO.concrete(e).ioOpCode === IOOpCode.YieldNow)
504
+ ) {
505
+ throw e;
506
+ } else if (isInterruptedException(e)) {
507
+ cur = IO.concrete(IO.failCauseNow(Cause.both(Cause.halt(e), Cause.interrupt(FiberId.none))));
508
+ } else {
509
+ cur = IO.concrete(IO.failCauseNow(Cause.halt(e)));
510
+ }
511
+ }
512
+ }
513
+ }
514
+
515
+ getInterruptedCause(): Cause<never> {
516
+ return this.getFiberRef(FiberRef.interruptedCause);
517
+ }
518
+
519
+ isInterrupted(): boolean {
520
+ return !this.getFiberRef(FiberRef.interruptedCause).isEmpty;
521
+ }
522
+
523
+ getFiberRef<A>(fiberRef: FiberRef<A>): A {
524
+ return this._fiberRefs.getOrDefault(fiberRef);
525
+ }
526
+
527
+ tell(message: FiberMessage): void {
528
+ this.queue.enqueue(message);
529
+ if (!this.running) {
530
+ this.running = true;
531
+ this.drainQueueLaterOnExecutor();
532
+ }
533
+ }
534
+
535
+ exitValue(): Exit<E, A> {
536
+ return this._exitValue;
537
+ }
538
+
539
+ addObserver(observer: (exit: Exit<E, A>) => void): void {
540
+ if (this._exitValue !== null) observer(this._exitValue);
541
+ else this.observers = Cons(observer, this.observers);
542
+ }
543
+
544
+ getChildren(): Set<FiberRuntime<any, any>> {
545
+ if (this._children === null) {
546
+ this._children = new Set();
547
+ }
548
+ return this._children;
549
+ }
550
+
551
+ getFiberRefs(): FiberRefs {
552
+ return this._fiberRefs;
553
+ }
554
+
555
+ setFiberRefs(fiberRefs0: FiberRefs): void {
556
+ this._fiberRefs = fiberRefs0;
557
+ }
558
+
559
+ private patchRuntimeFlags(oldRuntimeFlags: RuntimeFlags, patch: RuntimeFlags.Patch): RuntimeFlags {
560
+ const newRuntimeFlags = patch.patch(oldRuntimeFlags);
561
+
562
+ this._runtimeFlags = newRuntimeFlags;
563
+
564
+ return newRuntimeFlags;
565
+ }
566
+
567
+ private sendInterruptSignalToAllChildren(): boolean {
568
+ if (this._children === null || this._children.size === 0) return false;
569
+ else {
570
+ let told = false;
571
+ for (const child of this._children) {
572
+ if (child !== null) {
573
+ child.tell(FiberMessage.InterruptSignal(Cause.interrupt(this.id)));
574
+ told = true;
575
+ }
576
+ }
577
+ return told;
578
+ }
579
+ }
580
+
581
+ private interruptAllChildren(): UIO<any> {
582
+ if (this.sendInterruptSignalToAllChildren()) {
583
+ const iterator = this._children[Symbol.iterator]();
584
+
585
+ this._children = null!;
586
+
587
+ let value: IteratorResult<FiberRuntime<any, any>>;
588
+
589
+ const check = () => {
590
+ value = iterator.next();
591
+ return !value.done;
592
+ };
593
+
594
+ const body = () => {
595
+ if (value != null && !value.done) {
596
+ return value.value.await;
597
+ } else {
598
+ return IO.unit;
599
+ }
600
+ };
601
+
602
+ return new WhileLoop(
603
+ check,
604
+ body,
605
+ () => {
606
+ //
607
+ },
608
+ this.id.location,
609
+ );
610
+ } else {
611
+ return null!;
612
+ }
613
+ }
614
+
615
+ private initiateAsync(runtimeFlags: RuntimeFlags, asyncRegister: (k: (_: IO<any, any, any>) => void) => any): void {
616
+ let alreadyCalled = false;
617
+
618
+ const callback = (effect: IO<any, any, any>) => {
619
+ if (!alreadyCalled) {
620
+ alreadyCalled = true;
621
+ this.tell(FiberMessage.Resume(effect));
622
+ }
623
+ };
624
+
625
+ if (runtimeFlags.interruptible) this.asyncInterruptor = callback;
626
+
627
+ try {
628
+ asyncRegister(callback);
629
+ } catch (e) {
630
+ callback(IO.failCauseNow(Cause.halt(e)));
631
+ }
632
+ }
633
+
634
+ setFiberRef<A>(fiberRef: FiberRef<A>, value: A): void {
635
+ this._fiberRefs = this._fiberRefs.updateAs(this.fiberId, fiberRef, value);
636
+ }
637
+
638
+ private addInterruptedCause(cause: Cause<never>): void {
639
+ const oldSC = this.getFiberRef(FiberRef.interruptedCause);
640
+ if (oldSC.contains(cause)) {
641
+ return;
642
+ }
643
+ this.setFiberRef(FiberRef.interruptedCause, Cause.then(oldSC, cause));
644
+ }
645
+
646
+ private processNewInterruptSignal(cause: Cause<never>): void {
647
+ this.addInterruptedCause(cause);
648
+ this.sendInterruptSignalToAllChildren();
649
+ }
650
+
651
+ private evaluateMessageWhileSuspended(fiberMessage: FiberMessage): EvaluationSignal {
652
+ switch (fiberMessage._tag) {
653
+ case FiberMessageTag.InterruptSignal: {
654
+ this.processNewInterruptSignal(fiberMessage.cause);
655
+
656
+ if (this.asyncInterruptor !== null) {
657
+ this.asyncInterruptor(IO.failCause(fiberMessage.cause));
658
+ this.asyncInterruptor = null!;
659
+ }
660
+
661
+ return EvaluationSignal.Continue;
662
+ }
663
+ case FiberMessageTag.GenStackTrace: {
664
+ fiberMessage.onTrace(this.generateStackTrace());
665
+ return EvaluationSignal.Continue;
666
+ }
667
+ case FiberMessageTag.Stateful: {
668
+ let status: FiberStatus;
669
+ if (this._exitValue !== null) {
670
+ status = new Done();
671
+ } else if (this.asyncTrace === null) {
672
+ status = new Running(this._runtimeFlags, null!);
673
+ } else {
674
+ status = new Suspended(this._runtimeFlags, this.asyncBlockinOn, this.asyncTrace);
675
+ }
676
+
677
+ fiberMessage.onFiber(this, status);
678
+
679
+ return EvaluationSignal.Continue;
680
+ }
681
+ case FiberMessageTag.Resume: {
682
+ this.asyncInterruptor = null!;
683
+ this.asyncTrace = null!;
684
+ this.asyncBlockinOn = null!;
685
+
686
+ this.evaluateEffect(fiberMessage.cont);
687
+
688
+ return EvaluationSignal.Continue;
689
+ }
690
+ case FiberMessageTag.YieldNow: {
691
+ return EvaluationSignal.YieldNow;
692
+ }
693
+ }
694
+ }
695
+
696
+ private generateStackTrace() {
697
+ const builder = new StackTraceBuilder();
698
+
699
+ const stack = this.stack.clone();
700
+ while (stack.hasNext) {
701
+ builder.append(TraceElement.parse(stack.pop()!.trace));
702
+ }
703
+
704
+ return new Trace(this.fiberId, builder.result());
705
+ }
706
+
707
+ private setExitValue(exit: Exit<E, A>): void {
708
+ this._exitValue = exit;
709
+ for (const observer of this.observers) {
710
+ observer(exit);
711
+ }
712
+ this.observers = List.empty();
713
+ }
714
+
715
+ resume<R>(effect: IO<R, E, A>) {
716
+ this.tell(FiberMessage.Resume(effect));
717
+ }
718
+
719
+ start<R>(effect: IO<R, E, A>) {
720
+ if (!this.running) {
721
+ try {
722
+ this.running = true;
723
+ this.evaluateEffect(effect);
724
+ } finally {
725
+ this.running = false;
726
+ if (!this.queue.isEmpty) {
727
+ this.drainQueueLaterOnExecutor();
728
+ }
729
+ }
730
+ } else {
731
+ this.tell(FiberMessage.Resume(effect));
732
+ }
733
+ }
734
+
735
+ startFork<R>(effect: IO<R, E, A>): void {
736
+ this.tell(FiberMessage.Resume(effect));
737
+ }
738
+
739
+ updateFiberRef<A>(fiberRef: FiberRef<A>, f: (a: A) => A): void {
740
+ this.setFiberRef(fiberRef, f(this.getFiberRef(fiberRef)));
741
+ }
742
+
743
+ removeObserver(observer: (exit: Exit<E, A>) => void): void {
744
+ this.observers = this.observers.filter((f) => f !== observer);
745
+ }
746
+
747
+ addChild(child: FiberRuntime<any, any>): void {
748
+ this.getChildren().add(child);
749
+ }
750
+
751
+ removeChild(child: FiberRuntime<any, any>) {
752
+ if (this._children !== null) {
753
+ this._children.delete(child);
754
+ }
755
+ }
756
+
757
+ get scope() {
758
+ return FiberScope.unsafeMake(this);
759
+ }
760
+
761
+ log(message: () => string, cause: Cause<any>, overrideLogLevel: Maybe<LogLevel>, trace?: string): void {
762
+ const logLevel = overrideLogLevel.getOrElse(this.getFiberRef(FiberRef.currentLogLevel));
763
+ const spans = this.getFiberRef(FiberRef.currentLogSpan);
764
+ const annotations = this.getFiberRef(FiberRef.currentLogAnnotations);
765
+ const contextMap = this.getFiberRefs();
766
+ Logger.defaultString
767
+ .map((s) => console.log(s))
768
+ .filterLogLevel((level) => level >= LogLevel.Info)
769
+ .log(
770
+ TraceElement.parse(trace),
771
+ this.fiberId,
772
+ logLevel,
773
+ message,
774
+ cause,
775
+ contextMap.unFiberRefs,
776
+ spans,
777
+ annotations,
778
+ );
779
+ }
780
+
781
+ deleteFiberRef(ref: FiberRef<any>): void {
782
+ this._fiberRefs = this._fiberRefs.delete(ref);
783
+ }
784
+
785
+ location = this.fiberId.location;
786
+
787
+ get status(): UIO<FiberStatus> {
788
+ return this.ask((_, status) => status);
789
+ }
790
+
791
+ get trace(): UIO<Trace> {
792
+ return IO.defer(() => {
793
+ const future = Future.unsafeMake<never, Trace>(this.fiberId);
794
+ this.tell(FiberMessage.GenStackTrace((trace) => future.unsafeDone(IO.succeedNow(trace))));
795
+ return future.await;
796
+ });
797
+ }
798
+
799
+ getNextSuccessCont() {
800
+ while (this.stack.hasNext) {
801
+ const frame = this.stack.pop()!;
802
+ if (frame.ioOpCode !== IOOpCode.OnFailure) {
803
+ return frame;
804
+ }
805
+ }
806
+ }
807
+
808
+ getNextFailCont() {
809
+ while (this.stack.hasNext) {
810
+ const frame = this.stack.pop()!;
811
+ if (frame.ioOpCode !== IOOpCode.OnSuccess && frame.ioOpCode !== IOOpCode.WhileLoop) {
812
+ return frame;
813
+ }
814
+ }
815
+ }
816
+
817
+ isFatal(t: unknown): boolean {
818
+ return this.getFiberRef(FiberRef.currentIsFatal).apply(t);
819
+ }
820
+ }
821
+
822
+ const enum EvaluationSignal {
823
+ Continue,
824
+ YieldNow,
825
+ Done,
826
+ }