@fncts/io 0.0.49 → 0.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (635) hide show
  1. package/Channel/internal/SingleProducerAsyncInput.d.ts +1 -1
  2. package/CountdownLatch.d.ts +5 -5
  3. package/Fiber/FiberRuntime.d.ts +1 -1
  4. package/Hub/api.d.ts +7 -7
  5. package/IO/api/foreachExec.d.ts +18 -0
  6. package/IO/api.d.ts +1 -1
  7. package/Push/Bounds.d.ts +4 -0
  8. package/Push/FlattenStrategy.d.ts +47 -0
  9. package/Push/IndexedBuffer.d.ts +19 -0
  10. package/Push/MergeStrategy.d.ts +19 -0
  11. package/Push/Operator/IOLoopOperator.d.ts +61 -0
  12. package/Push/Operator/IOOperator.d.ts +63 -0
  13. package/Push/Operator/LoopOperator.d.ts +50 -0
  14. package/Push/Operator/SyncOperator.d.ts +41 -0
  15. package/Push/Operator.d.ts +4 -0
  16. package/Push/Producer/IOProducer.d.ts +41 -0
  17. package/Push/Producer/SyncProducer.d.ts +61 -0
  18. package/Push/Producer.d.ts +1 -0
  19. package/Push/Sink.d.ts +65 -0
  20. package/Push/api.d.ts +80 -163
  21. package/Push/definition.d.ts +92 -19
  22. package/Push/internal.d.ts +3 -0
  23. package/Push.d.ts +6 -0
  24. package/Queue/api/dimapIO.d.ts +12 -12
  25. package/Ref/Synchronized/definition.d.ts +32 -9
  26. package/Ref/definition.d.ts +12 -0
  27. package/STM/api.d.ts +1 -1
  28. package/Scope/api.d.ts +16 -1
  29. package/Semaphore/definition.d.ts +1 -1
  30. package/Sink/definition.d.ts +5 -6
  31. package/Subject/Atomic.d.ts +19 -9
  32. package/Subject/DeferredRef.d.ts +17 -0
  33. package/Subject/Hold.d.ts +19 -0
  34. package/Subject/RefSubject/Atomic.d.ts +43 -0
  35. package/Subject/RefSubject/Derived.d.ts +43 -0
  36. package/Subject/RefSubject/RefSubject.d.ts +37 -0
  37. package/Subject/RefSubject/constructors.d.ts +15 -0
  38. package/Subject/RefSubject.d.ts +4 -0
  39. package/Subject/definition.d.ts +14 -2
  40. package/Subject.d.ts +3 -0
  41. package/SubscriptionRef.d.ts +0 -1
  42. package/Supervisor/definition.d.ts +1 -1
  43. package/_cjs/Cached/api.cjs +8 -2
  44. package/_cjs/Cached/api.cjs.map +1 -1
  45. package/_cjs/Cached/definition.cjs +2 -6
  46. package/_cjs/Cached/definition.cjs.map +1 -1
  47. package/_cjs/CancellerState.cjs +4 -7
  48. package/_cjs/CancellerState.cjs.map +1 -1
  49. package/_cjs/Channel/UpstreamPullRequest/definition.cjs +4 -2
  50. package/_cjs/Channel/UpstreamPullRequest/definition.cjs.map +1 -1
  51. package/_cjs/Channel/api.cjs +2 -3
  52. package/_cjs/Channel/api.cjs.map +1 -1
  53. package/_cjs/Channel/definition.cjs +22 -16
  54. package/_cjs/Channel/definition.cjs.map +1 -1
  55. package/_cjs/Channel/internal/ChannelExecutor.cjs +35 -11
  56. package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
  57. package/_cjs/Channel/internal/ChannelState.cjs +15 -8
  58. package/_cjs/Channel/internal/ChannelState.cjs.map +1 -1
  59. package/_cjs/Channel/internal/MergeDecision.cjs +6 -8
  60. package/_cjs/Channel/internal/MergeDecision.cjs.map +1 -1
  61. package/_cjs/Channel/internal/MergeState.cjs +7 -3
  62. package/_cjs/Channel/internal/MergeState.cjs.map +1 -1
  63. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +49 -42
  64. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
  65. package/_cjs/Clock/live.cjs +1 -4
  66. package/_cjs/Clock/live.cjs.map +1 -1
  67. package/_cjs/CountdownLatch.cjs +22 -12
  68. package/_cjs/CountdownLatch.cjs.map +1 -1
  69. package/_cjs/Differ/api.cjs +3 -12
  70. package/_cjs/Differ/api.cjs.map +1 -1
  71. package/_cjs/Differ/definition.cjs +1 -5
  72. package/_cjs/Differ/definition.cjs.map +1 -1
  73. package/_cjs/Fiber/FiberMessage.cjs +6 -3
  74. package/_cjs/Fiber/FiberMessage.cjs.map +1 -1
  75. package/_cjs/Fiber/FiberRuntime.cjs +66 -61
  76. package/_cjs/Fiber/FiberRuntime.cjs.map +1 -1
  77. package/_cjs/Fiber/definition.cjs +10 -6
  78. package/_cjs/Fiber/definition.cjs.map +1 -1
  79. package/_cjs/FiberDescriptor.cjs +3 -0
  80. package/_cjs/FiberDescriptor.cjs.map +1 -1
  81. package/_cjs/FiberRef/definition.cjs +9 -6
  82. package/_cjs/FiberRef/definition.cjs.map +1 -1
  83. package/_cjs/FiberRefs/Patch.cjs +13 -13
  84. package/_cjs/FiberRefs/Patch.cjs.map +1 -1
  85. package/_cjs/FiberScope/definition.cjs +2 -0
  86. package/_cjs/FiberScope/definition.cjs.map +1 -1
  87. package/_cjs/FiberSet.cjs +4 -3
  88. package/_cjs/FiberSet.cjs.map +1 -1
  89. package/_cjs/FiberStatus/definition.cjs +12 -9
  90. package/_cjs/FiberStatus/definition.cjs.map +1 -1
  91. package/_cjs/Future/State.cjs +8 -7
  92. package/_cjs/Future/State.cjs.map +1 -1
  93. package/_cjs/Future/definition.cjs +3 -3
  94. package/_cjs/Future/definition.cjs.map +1 -1
  95. package/_cjs/Hub/api.cjs +61 -44
  96. package/_cjs/Hub/api.cjs.map +1 -1
  97. package/_cjs/Hub/definition.cjs +4 -8
  98. package/_cjs/Hub/definition.cjs.map +1 -1
  99. package/_cjs/Hub/internal.cjs +130 -110
  100. package/_cjs/Hub/internal.cjs.map +1 -1
  101. package/_cjs/IO/api/foreachExec.cjs +29 -4
  102. package/_cjs/IO/api/foreachExec.cjs.map +1 -1
  103. package/_cjs/IO/api/transplant.cjs +8 -7
  104. package/_cjs/IO/api/transplant.cjs.map +1 -1
  105. package/_cjs/IO/api.cjs +9 -4
  106. package/_cjs/IO/api.cjs.map +1 -1
  107. package/_cjs/IO/definition.cjs +8 -12
  108. package/_cjs/IO/definition.cjs.map +1 -1
  109. package/_cjs/IO/runtime.cjs +64 -61
  110. package/_cjs/IO/runtime.cjs.map +1 -1
  111. package/_cjs/InterruptStatus/definition.cjs +1 -0
  112. package/_cjs/InterruptStatus/definition.cjs.map +1 -1
  113. package/_cjs/Layer/MemoMap.cjs +25 -24
  114. package/_cjs/Layer/MemoMap.cjs.map +1 -1
  115. package/_cjs/Layer/definition.cjs +30 -13
  116. package/_cjs/Layer/definition.cjs.map +1 -1
  117. package/_cjs/LogLevel.cjs +3 -0
  118. package/_cjs/LogLevel.cjs.map +1 -1
  119. package/_cjs/LogSpan.cjs +2 -0
  120. package/_cjs/LogSpan.cjs.map +1 -1
  121. package/_cjs/Logger/definition.cjs +1 -0
  122. package/_cjs/Logger/definition.cjs.map +1 -1
  123. package/_cjs/MVar/definition.cjs +3 -4
  124. package/_cjs/MVar/definition.cjs.map +1 -1
  125. package/_cjs/Push/Bounds.cjs +2 -0
  126. package/_cjs/Push/Bounds.cjs.map +1 -0
  127. package/_cjs/Push/FlattenStrategy.cjs +96 -0
  128. package/_cjs/Push/FlattenStrategy.cjs.map +1 -0
  129. package/_cjs/Push/IndexedBuffer.cjs +74 -0
  130. package/_cjs/Push/IndexedBuffer.cjs.map +1 -0
  131. package/_cjs/Push/MergeStrategy.cjs +47 -0
  132. package/_cjs/Push/MergeStrategy.cjs.map +1 -0
  133. package/_cjs/Push/Operator/IOLoopOperator.cjs +225 -0
  134. package/_cjs/Push/Operator/IOLoopOperator.cjs.map +1 -0
  135. package/_cjs/Push/Operator/IOOperator.cjs +104 -0
  136. package/_cjs/Push/Operator/IOOperator.cjs.map +1 -0
  137. package/_cjs/Push/Operator/LoopOperator.cjs +165 -0
  138. package/_cjs/Push/Operator/LoopOperator.cjs.map +1 -0
  139. package/_cjs/Push/Operator/SyncOperator.cjs +78 -0
  140. package/_cjs/Push/Operator/SyncOperator.cjs.map +1 -0
  141. package/_cjs/Push/Operator.cjs +2 -0
  142. package/_cjs/Push/Operator.cjs.map +1 -0
  143. package/_cjs/Push/Producer/IOProducer.cjs +72 -0
  144. package/_cjs/Push/Producer/IOProducer.cjs.map +1 -0
  145. package/_cjs/Push/Producer/SyncProducer.cjs +111 -0
  146. package/_cjs/Push/Producer/SyncProducer.cjs.map +1 -0
  147. package/_cjs/Push/Producer.cjs +2 -0
  148. package/_cjs/Push/Producer.cjs.map +1 -0
  149. package/_cjs/Push/Sink.cjs +238 -0
  150. package/_cjs/Push/Sink.cjs.map +1 -0
  151. package/_cjs/Push/api.cjs +369 -387
  152. package/_cjs/Push/api.cjs.map +1 -1
  153. package/_cjs/Push/definition.cjs +82 -26
  154. package/_cjs/Push/definition.cjs.map +1 -1
  155. package/_cjs/Push/internal.cjs +31 -26
  156. package/_cjs/Push/internal.cjs.map +1 -1
  157. package/_cjs/Push.cjs +66 -0
  158. package/_cjs/Push.cjs.map +1 -1
  159. package/_cjs/Queue/api/dimapIO.cjs +74 -32
  160. package/_cjs/Queue/api/dimapIO.cjs.map +1 -1
  161. package/_cjs/Queue/api/filterInputIO.cjs +51 -25
  162. package/_cjs/Queue/api/filterInputIO.cjs.map +1 -1
  163. package/_cjs/Queue/api/filterOutputIO.cjs +60 -30
  164. package/_cjs/Queue/api/filterOutputIO.cjs.map +1 -1
  165. package/_cjs/Queue/api/zipWithIO.cjs +27 -10
  166. package/_cjs/Queue/api/zipWithIO.cjs.map +1 -1
  167. package/_cjs/Queue/definition.cjs +3 -7
  168. package/_cjs/Queue/definition.cjs.map +1 -1
  169. package/_cjs/Queue/internal.cjs +73 -62
  170. package/_cjs/Queue/internal.cjs.map +1 -1
  171. package/_cjs/Queue/strategy.cjs +1 -3
  172. package/_cjs/Queue/strategy.cjs.map +1 -1
  173. package/_cjs/Random/live.cjs +4 -3
  174. package/_cjs/Random/live.cjs.map +1 -1
  175. package/_cjs/Ref/Atomic.cjs +2 -3
  176. package/_cjs/Ref/Atomic.cjs.map +1 -1
  177. package/_cjs/Ref/Derived.cjs +2 -3
  178. package/_cjs/Ref/Derived.cjs.map +1 -1
  179. package/_cjs/Ref/DerivedAll.cjs +2 -3
  180. package/_cjs/Ref/DerivedAll.cjs.map +1 -1
  181. package/_cjs/Ref/Synchronized/definition.cjs +17 -16
  182. package/_cjs/Ref/Synchronized/definition.cjs.map +1 -1
  183. package/_cjs/Ref/definition.cjs +2 -6
  184. package/_cjs/Ref/definition.cjs.map +1 -1
  185. package/_cjs/Reloadable/definition.cjs +2 -0
  186. package/_cjs/Reloadable/definition.cjs.map +1 -1
  187. package/_cjs/STM/definition.cjs +30 -25
  188. package/_cjs/STM/definition.cjs.map +1 -1
  189. package/_cjs/STM/driver.cjs +5 -0
  190. package/_cjs/STM/driver.cjs.map +1 -1
  191. package/_cjs/STM/internal/Entry.cjs +9 -6
  192. package/_cjs/STM/internal/Entry.cjs.map +1 -1
  193. package/_cjs/STM/internal/TryCommit.cjs +6 -7
  194. package/_cjs/STM/internal/TryCommit.cjs.map +1 -1
  195. package/_cjs/STM/internal/Versioned.cjs +2 -3
  196. package/_cjs/STM/internal/Versioned.cjs.map +1 -1
  197. package/_cjs/Schedule/Decision.cjs +3 -4
  198. package/_cjs/Schedule/Decision.cjs.map +1 -1
  199. package/_cjs/Schedule/Driver.cjs +4 -0
  200. package/_cjs/Schedule/Driver.cjs.map +1 -1
  201. package/_cjs/Schedule/api.cjs +2 -5
  202. package/_cjs/Schedule/api.cjs.map +1 -1
  203. package/_cjs/Schedule/definition.cjs +3 -1
  204. package/_cjs/Schedule/definition.cjs.map +1 -1
  205. package/_cjs/Scope/ReleaseMap/definition.cjs +8 -2
  206. package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
  207. package/_cjs/Scope/api.cjs +29 -11
  208. package/_cjs/Scope/api.cjs.map +1 -1
  209. package/_cjs/Scope/definition.cjs +3 -7
  210. package/_cjs/Scope/definition.cjs.map +1 -1
  211. package/_cjs/ScopedRef/api.cjs +8 -3
  212. package/_cjs/ScopedRef/api.cjs.map +1 -1
  213. package/_cjs/ScopedRef/definition.cjs +1 -5
  214. package/_cjs/ScopedRef/definition.cjs.map +1 -1
  215. package/_cjs/Semaphore/Reservation.cjs +2 -0
  216. package/_cjs/Semaphore/Reservation.cjs.map +1 -1
  217. package/_cjs/Semaphore/definition.cjs +42 -38
  218. package/_cjs/Semaphore/definition.cjs.map +1 -1
  219. package/_cjs/Sink/definition.cjs +3 -3
  220. package/_cjs/Sink/definition.cjs.map +1 -1
  221. package/_cjs/State/api.cjs +1 -4
  222. package/_cjs/State/api.cjs.map +1 -1
  223. package/_cjs/State/definition.cjs +2 -6
  224. package/_cjs/State/definition.cjs.map +1 -1
  225. package/_cjs/State/internal.cjs +1 -5
  226. package/_cjs/State/internal.cjs.map +1 -1
  227. package/_cjs/Stream/api/zipAllWith.cjs +7 -11
  228. package/_cjs/Stream/api/zipAllWith.cjs.map +1 -1
  229. package/_cjs/Stream/api/zipWithChunks.cjs +5 -5
  230. package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -1
  231. package/_cjs/Stream/api.cjs +8 -7
  232. package/_cjs/Stream/api.cjs.map +1 -1
  233. package/_cjs/Stream/definition.cjs +3 -4
  234. package/_cjs/Stream/definition.cjs.map +1 -1
  235. package/_cjs/Stream/internal/DebounceState.cjs +5 -5
  236. package/_cjs/Stream/internal/DebounceState.cjs.map +1 -1
  237. package/_cjs/Stream/internal/Handoff.cjs +18 -17
  238. package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
  239. package/_cjs/Stream/internal/SinkEndReason.cjs +5 -12
  240. package/_cjs/Stream/internal/SinkEndReason.cjs.map +1 -1
  241. package/_cjs/Stream/internal/Take.cjs +3 -0
  242. package/_cjs/Stream/internal/Take.cjs.map +1 -1
  243. package/_cjs/Subject/Atomic.cjs +45 -15
  244. package/_cjs/Subject/Atomic.cjs.map +1 -1
  245. package/_cjs/Subject/DeferredRef.cjs +56 -0
  246. package/_cjs/Subject/DeferredRef.cjs.map +1 -0
  247. package/_cjs/Subject/Hold.cjs +38 -0
  248. package/_cjs/Subject/Hold.cjs.map +1 -0
  249. package/_cjs/Subject/RefSubject/Atomic.cjs +171 -0
  250. package/_cjs/Subject/RefSubject/Atomic.cjs.map +1 -0
  251. package/_cjs/Subject/RefSubject/Derived.cjs +103 -0
  252. package/_cjs/Subject/RefSubject/Derived.cjs.map +1 -0
  253. package/_cjs/Subject/RefSubject/RefSubject.cjs +18 -0
  254. package/_cjs/Subject/RefSubject/RefSubject.cjs.map +1 -0
  255. package/_cjs/Subject/RefSubject/constructors.cjs +30 -0
  256. package/_cjs/Subject/RefSubject/constructors.cjs.map +1 -0
  257. package/_cjs/Subject/RefSubject.cjs +2 -0
  258. package/_cjs/Subject/RefSubject.cjs.map +1 -0
  259. package/_cjs/Subject/definition.cjs +11 -1
  260. package/_cjs/Subject/definition.cjs.map +1 -1
  261. package/_cjs/Subject.cjs +33 -0
  262. package/_cjs/Subject.cjs.map +1 -1
  263. package/_cjs/SubscriptionRef.cjs +4 -5
  264. package/_cjs/SubscriptionRef.cjs.map +1 -1
  265. package/_cjs/Supervisor/constructors.cjs +3 -11
  266. package/_cjs/Supervisor/constructors.cjs.map +1 -1
  267. package/_cjs/Supervisor/definition.cjs +10 -4
  268. package/_cjs/Supervisor/definition.cjs.map +1 -1
  269. package/_cjs/SupervisorPatch.cjs +9 -12
  270. package/_cjs/SupervisorPatch.cjs.map +1 -1
  271. package/_cjs/TExit/definition.cjs +19 -18
  272. package/_cjs/TExit/definition.cjs.map +1 -1
  273. package/_cjs/TReentrantLock/definition.cjs +8 -3
  274. package/_cjs/TReentrantLock/definition.cjs.map +1 -1
  275. package/_cjs/TRef/definition.cjs +6 -6
  276. package/_cjs/TRef/definition.cjs.map +1 -1
  277. package/_cjs/internal/BackgroundScheduler.cjs +16 -16
  278. package/_cjs/internal/BackgroundScheduler.cjs.map +1 -1
  279. package/_cjs/internal/HashedPair.cjs +2 -0
  280. package/_cjs/internal/HashedPair.cjs.map +1 -1
  281. package/_cjs/internal/Hub.cjs +39 -15
  282. package/_cjs/internal/Hub.cjs.map +1 -1
  283. package/_cjs/internal/IsFatal.cjs +7 -11
  284. package/_cjs/internal/IsFatal.cjs.map +1 -1
  285. package/_cjs/internal/MutableQueue.cjs +14 -11
  286. package/_cjs/internal/MutableQueue.cjs.map +1 -1
  287. package/_cjs/internal/Scheduler.cjs +4 -8
  288. package/_cjs/internal/Scheduler.cjs.map +1 -1
  289. package/_cjs/internal/StackTraceBuilder.cjs +2 -4
  290. package/_cjs/internal/StackTraceBuilder.cjs.map +1 -1
  291. package/_mjs/Cached/api.mjs +8 -2
  292. package/_mjs/Cached/api.mjs.map +1 -1
  293. package/_mjs/Cached/definition.mjs +1 -5
  294. package/_mjs/Cached/definition.mjs.map +1 -1
  295. package/_mjs/CancellerState.mjs +4 -7
  296. package/_mjs/CancellerState.mjs.map +1 -1
  297. package/_mjs/Channel/UpstreamPullRequest/definition.mjs +4 -2
  298. package/_mjs/Channel/UpstreamPullRequest/definition.mjs.map +1 -1
  299. package/_mjs/Channel/api.mjs +2 -3
  300. package/_mjs/Channel/api.mjs.map +1 -1
  301. package/_mjs/Channel/definition.mjs +21 -15
  302. package/_mjs/Channel/definition.mjs.map +1 -1
  303. package/_mjs/Channel/internal/ChannelExecutor.mjs +35 -11
  304. package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
  305. package/_mjs/Channel/internal/ChannelState.mjs +15 -8
  306. package/_mjs/Channel/internal/ChannelState.mjs.map +1 -1
  307. package/_mjs/Channel/internal/MergeDecision.mjs +5 -7
  308. package/_mjs/Channel/internal/MergeDecision.mjs.map +1 -1
  309. package/_mjs/Channel/internal/MergeState.mjs +7 -3
  310. package/_mjs/Channel/internal/MergeState.mjs.map +1 -1
  311. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs +49 -42
  312. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs.map +1 -1
  313. package/_mjs/Clock/live.mjs +1 -4
  314. package/_mjs/Clock/live.mjs.map +1 -1
  315. package/_mjs/CountdownLatch.mjs +21 -11
  316. package/_mjs/CountdownLatch.mjs.map +1 -1
  317. package/_mjs/Differ/api.mjs +3 -12
  318. package/_mjs/Differ/api.mjs.map +1 -1
  319. package/_mjs/Differ/definition.mjs +1 -5
  320. package/_mjs/Differ/definition.mjs.map +1 -1
  321. package/_mjs/Fiber/FiberMessage.mjs +6 -3
  322. package/_mjs/Fiber/FiberMessage.mjs.map +1 -1
  323. package/_mjs/Fiber/FiberRuntime.mjs +66 -61
  324. package/_mjs/Fiber/FiberRuntime.mjs.map +1 -1
  325. package/_mjs/Fiber/definition.mjs +9 -5
  326. package/_mjs/Fiber/definition.mjs.map +1 -1
  327. package/_mjs/FiberDescriptor.mjs +3 -0
  328. package/_mjs/FiberDescriptor.mjs.map +1 -1
  329. package/_mjs/FiberRef/definition.mjs +9 -6
  330. package/_mjs/FiberRef/definition.mjs.map +1 -1
  331. package/_mjs/FiberRefs/Patch.mjs +13 -13
  332. package/_mjs/FiberRefs/Patch.mjs.map +1 -1
  333. package/_mjs/FiberScope/definition.mjs +2 -0
  334. package/_mjs/FiberScope/definition.mjs.map +1 -1
  335. package/_mjs/FiberSet.mjs +4 -3
  336. package/_mjs/FiberSet.mjs.map +1 -1
  337. package/_mjs/FiberStatus/definition.mjs +12 -9
  338. package/_mjs/FiberStatus/definition.mjs.map +1 -1
  339. package/_mjs/Future/State.mjs +8 -7
  340. package/_mjs/Future/State.mjs.map +1 -1
  341. package/_mjs/Future/definition.mjs +3 -3
  342. package/_mjs/Future/definition.mjs.map +1 -1
  343. package/_mjs/Hub/api.mjs +61 -44
  344. package/_mjs/Hub/api.mjs.map +1 -1
  345. package/_mjs/Hub/definition.mjs +3 -7
  346. package/_mjs/Hub/definition.mjs.map +1 -1
  347. package/_mjs/Hub/internal.mjs +130 -110
  348. package/_mjs/Hub/internal.mjs.map +1 -1
  349. package/_mjs/IO/api/foreachExec.mjs +27 -4
  350. package/_mjs/IO/api/foreachExec.mjs.map +1 -1
  351. package/_mjs/IO/api/transplant.mjs +8 -7
  352. package/_mjs/IO/api/transplant.mjs.map +1 -1
  353. package/_mjs/IO/api.mjs +9 -4
  354. package/_mjs/IO/api.mjs.map +1 -1
  355. package/_mjs/IO/definition.mjs +7 -11
  356. package/_mjs/IO/definition.mjs.map +1 -1
  357. package/_mjs/IO/runtime.mjs +64 -61
  358. package/_mjs/IO/runtime.mjs.map +1 -1
  359. package/_mjs/InterruptStatus/definition.mjs +1 -0
  360. package/_mjs/InterruptStatus/definition.mjs.map +1 -1
  361. package/_mjs/Layer/MemoMap.mjs +25 -24
  362. package/_mjs/Layer/MemoMap.mjs.map +1 -1
  363. package/_mjs/Layer/definition.mjs +29 -12
  364. package/_mjs/Layer/definition.mjs.map +1 -1
  365. package/_mjs/LogLevel.mjs +3 -0
  366. package/_mjs/LogLevel.mjs.map +1 -1
  367. package/_mjs/LogSpan.mjs +2 -0
  368. package/_mjs/LogSpan.mjs.map +1 -1
  369. package/_mjs/Logger/definition.mjs +1 -0
  370. package/_mjs/Logger/definition.mjs.map +1 -1
  371. package/_mjs/MVar/definition.mjs +2 -3
  372. package/_mjs/MVar/definition.mjs.map +1 -1
  373. package/_mjs/Push/Bounds.mjs +2 -0
  374. package/_mjs/Push/Bounds.mjs.map +1 -0
  375. package/_mjs/Push/FlattenStrategy.mjs +87 -0
  376. package/_mjs/Push/FlattenStrategy.mjs.map +1 -0
  377. package/_mjs/Push/IndexedBuffer.mjs +65 -0
  378. package/_mjs/Push/IndexedBuffer.mjs.map +1 -0
  379. package/_mjs/Push/MergeStrategy.mjs +36 -0
  380. package/_mjs/Push/MergeStrategy.mjs.map +1 -0
  381. package/_mjs/Push/Operator/IOLoopOperator.mjs +208 -0
  382. package/_mjs/Push/Operator/IOLoopOperator.mjs.map +1 -0
  383. package/_mjs/Push/Operator/IOOperator.mjs +91 -0
  384. package/_mjs/Push/Operator/IOOperator.mjs.map +1 -0
  385. package/_mjs/Push/Operator/LoopOperator.mjs +151 -0
  386. package/_mjs/Push/Operator/LoopOperator.mjs.map +1 -0
  387. package/_mjs/Push/Operator/SyncOperator.mjs +67 -0
  388. package/_mjs/Push/Operator/SyncOperator.mjs.map +1 -0
  389. package/_mjs/Push/Operator.mjs +2 -0
  390. package/_mjs/Push/Operator.mjs.map +1 -0
  391. package/_mjs/Push/Producer/IOProducer.mjs +60 -0
  392. package/_mjs/Push/Producer/IOProducer.mjs.map +1 -0
  393. package/_mjs/Push/Producer/SyncProducer.mjs +94 -0
  394. package/_mjs/Push/Producer/SyncProducer.mjs.map +1 -0
  395. package/_mjs/Push/Producer.mjs +2 -0
  396. package/_mjs/Push/Producer.mjs.map +1 -0
  397. package/_mjs/Push/Sink.mjs +225 -0
  398. package/_mjs/Push/Sink.mjs.map +1 -0
  399. package/_mjs/Push/api.mjs +340 -348
  400. package/_mjs/Push/api.mjs.map +1 -1
  401. package/_mjs/Push/definition.mjs +75 -21
  402. package/_mjs/Push/definition.mjs.map +1 -1
  403. package/_mjs/Push/internal.mjs +30 -26
  404. package/_mjs/Push/internal.mjs.map +1 -1
  405. package/_mjs/Push.mjs +7 -1
  406. package/_mjs/Push.mjs.map +1 -1
  407. package/_mjs/Queue/api/dimapIO.mjs +74 -32
  408. package/_mjs/Queue/api/dimapIO.mjs.map +1 -1
  409. package/_mjs/Queue/api/filterInputIO.mjs +51 -25
  410. package/_mjs/Queue/api/filterInputIO.mjs.map +1 -1
  411. package/_mjs/Queue/api/filterOutputIO.mjs +60 -30
  412. package/_mjs/Queue/api/filterOutputIO.mjs.map +1 -1
  413. package/_mjs/Queue/api/zipWithIO.mjs +27 -10
  414. package/_mjs/Queue/api/zipWithIO.mjs.map +1 -1
  415. package/_mjs/Queue/definition.mjs +3 -7
  416. package/_mjs/Queue/definition.mjs.map +1 -1
  417. package/_mjs/Queue/internal.mjs +73 -62
  418. package/_mjs/Queue/internal.mjs.map +1 -1
  419. package/_mjs/Queue/strategy.mjs +1 -3
  420. package/_mjs/Queue/strategy.mjs.map +1 -1
  421. package/_mjs/Random/live.mjs +4 -3
  422. package/_mjs/Random/live.mjs.map +1 -1
  423. package/_mjs/Ref/Atomic.mjs +2 -3
  424. package/_mjs/Ref/Atomic.mjs.map +1 -1
  425. package/_mjs/Ref/Derived.mjs +2 -3
  426. package/_mjs/Ref/Derived.mjs.map +1 -1
  427. package/_mjs/Ref/DerivedAll.mjs +2 -3
  428. package/_mjs/Ref/DerivedAll.mjs.map +1 -1
  429. package/_mjs/Ref/Synchronized/definition.mjs +16 -15
  430. package/_mjs/Ref/Synchronized/definition.mjs.map +1 -1
  431. package/_mjs/Ref/definition.mjs +1 -5
  432. package/_mjs/Ref/definition.mjs.map +1 -1
  433. package/_mjs/Reloadable/definition.mjs +2 -0
  434. package/_mjs/Reloadable/definition.mjs.map +1 -1
  435. package/_mjs/STM/definition.mjs +29 -24
  436. package/_mjs/STM/definition.mjs.map +1 -1
  437. package/_mjs/STM/driver.mjs +5 -0
  438. package/_mjs/STM/driver.mjs.map +1 -1
  439. package/_mjs/STM/internal/Entry.mjs +8 -5
  440. package/_mjs/STM/internal/Entry.mjs.map +1 -1
  441. package/_mjs/STM/internal/TryCommit.mjs +6 -7
  442. package/_mjs/STM/internal/TryCommit.mjs.map +1 -1
  443. package/_mjs/STM/internal/Versioned.mjs +2 -3
  444. package/_mjs/STM/internal/Versioned.mjs.map +1 -1
  445. package/_mjs/Schedule/Decision.mjs +3 -4
  446. package/_mjs/Schedule/Decision.mjs.map +1 -1
  447. package/_mjs/Schedule/Driver.mjs +4 -0
  448. package/_mjs/Schedule/Driver.mjs.map +1 -1
  449. package/_mjs/Schedule/api.mjs +2 -5
  450. package/_mjs/Schedule/api.mjs.map +1 -1
  451. package/_mjs/Schedule/definition.mjs +3 -1
  452. package/_mjs/Schedule/definition.mjs.map +1 -1
  453. package/_mjs/Scope/ReleaseMap/definition.mjs +8 -2
  454. package/_mjs/Scope/ReleaseMap/definition.mjs.map +1 -1
  455. package/_mjs/Scope/api.mjs +23 -8
  456. package/_mjs/Scope/api.mjs.map +1 -1
  457. package/_mjs/Scope/definition.mjs +2 -6
  458. package/_mjs/Scope/definition.mjs.map +1 -1
  459. package/_mjs/ScopedRef/api.mjs +8 -3
  460. package/_mjs/ScopedRef/api.mjs.map +1 -1
  461. package/_mjs/ScopedRef/definition.mjs +1 -5
  462. package/_mjs/ScopedRef/definition.mjs.map +1 -1
  463. package/_mjs/Semaphore/Reservation.mjs +2 -0
  464. package/_mjs/Semaphore/Reservation.mjs.map +1 -1
  465. package/_mjs/Semaphore/definition.mjs +42 -38
  466. package/_mjs/Semaphore/definition.mjs.map +1 -1
  467. package/_mjs/Sink/definition.mjs +3 -3
  468. package/_mjs/Sink/definition.mjs.map +1 -1
  469. package/_mjs/State/api.mjs +1 -4
  470. package/_mjs/State/api.mjs.map +1 -1
  471. package/_mjs/State/definition.mjs +1 -5
  472. package/_mjs/State/definition.mjs.map +1 -1
  473. package/_mjs/State/internal.mjs +1 -5
  474. package/_mjs/State/internal.mjs.map +1 -1
  475. package/_mjs/Stream/api/zipAllWith.mjs +7 -11
  476. package/_mjs/Stream/api/zipAllWith.mjs.map +1 -1
  477. package/_mjs/Stream/api/zipWithChunks.mjs +5 -5
  478. package/_mjs/Stream/api/zipWithChunks.mjs.map +1 -1
  479. package/_mjs/Stream/api.mjs +8 -7
  480. package/_mjs/Stream/api.mjs.map +1 -1
  481. package/_mjs/Stream/definition.mjs +2 -3
  482. package/_mjs/Stream/definition.mjs.map +1 -1
  483. package/_mjs/Stream/internal/DebounceState.mjs +5 -5
  484. package/_mjs/Stream/internal/DebounceState.mjs.map +1 -1
  485. package/_mjs/Stream/internal/Handoff.mjs +17 -16
  486. package/_mjs/Stream/internal/Handoff.mjs.map +1 -1
  487. package/_mjs/Stream/internal/SinkEndReason.mjs +4 -11
  488. package/_mjs/Stream/internal/SinkEndReason.mjs.map +1 -1
  489. package/_mjs/Stream/internal/Take.mjs +3 -0
  490. package/_mjs/Stream/internal/Take.mjs.map +1 -1
  491. package/_mjs/Subject/Atomic.mjs +46 -15
  492. package/_mjs/Subject/Atomic.mjs.map +1 -1
  493. package/_mjs/Subject/DeferredRef.mjs +48 -0
  494. package/_mjs/Subject/DeferredRef.mjs.map +1 -0
  495. package/_mjs/Subject/Hold.mjs +30 -0
  496. package/_mjs/Subject/Hold.mjs.map +1 -0
  497. package/_mjs/Subject/RefSubject/Atomic.mjs +163 -0
  498. package/_mjs/Subject/RefSubject/Atomic.mjs.map +1 -0
  499. package/_mjs/Subject/RefSubject/Derived.mjs +95 -0
  500. package/_mjs/Subject/RefSubject/Derived.mjs.map +1 -0
  501. package/_mjs/Subject/RefSubject/RefSubject.mjs +11 -0
  502. package/_mjs/Subject/RefSubject/RefSubject.mjs.map +1 -0
  503. package/_mjs/Subject/RefSubject/constructors.mjs +23 -0
  504. package/_mjs/Subject/RefSubject/constructors.mjs.map +1 -0
  505. package/_mjs/Subject/RefSubject.mjs +2 -0
  506. package/_mjs/Subject/RefSubject.mjs.map +1 -0
  507. package/_mjs/Subject/definition.mjs +9 -0
  508. package/_mjs/Subject/definition.mjs.map +1 -1
  509. package/_mjs/Subject.mjs +3 -0
  510. package/_mjs/Subject.mjs.map +1 -1
  511. package/_mjs/SubscriptionRef.mjs +4 -5
  512. package/_mjs/SubscriptionRef.mjs.map +1 -1
  513. package/_mjs/Supervisor/constructors.mjs +3 -11
  514. package/_mjs/Supervisor/constructors.mjs.map +1 -1
  515. package/_mjs/Supervisor/definition.mjs +10 -4
  516. package/_mjs/Supervisor/definition.mjs.map +1 -1
  517. package/_mjs/SupervisorPatch.mjs +9 -12
  518. package/_mjs/SupervisorPatch.mjs.map +1 -1
  519. package/_mjs/TExit/definition.mjs +19 -18
  520. package/_mjs/TExit/definition.mjs.map +1 -1
  521. package/_mjs/TReentrantLock/definition.mjs +8 -3
  522. package/_mjs/TReentrantLock/definition.mjs.map +1 -1
  523. package/_mjs/TRef/definition.mjs +6 -6
  524. package/_mjs/TRef/definition.mjs.map +1 -1
  525. package/_mjs/internal/BackgroundScheduler.mjs +16 -16
  526. package/_mjs/internal/BackgroundScheduler.mjs.map +1 -1
  527. package/_mjs/internal/HashedPair.mjs +2 -0
  528. package/_mjs/internal/HashedPair.mjs.map +1 -1
  529. package/_mjs/internal/Hub.mjs +39 -15
  530. package/_mjs/internal/Hub.mjs.map +1 -1
  531. package/_mjs/internal/IsFatal.mjs +7 -11
  532. package/_mjs/internal/IsFatal.mjs.map +1 -1
  533. package/_mjs/internal/MutableQueue.mjs +14 -11
  534. package/_mjs/internal/MutableQueue.mjs.map +1 -1
  535. package/_mjs/internal/Scheduler.mjs +4 -8
  536. package/_mjs/internal/Scheduler.mjs.map +1 -1
  537. package/_mjs/internal/StackTraceBuilder.mjs +2 -4
  538. package/_mjs/internal/StackTraceBuilder.mjs.map +1 -1
  539. package/_src/Cached/api.ts +8 -2
  540. package/_src/Channel/internal/SingleProducerAsyncInput.ts +6 -4
  541. package/_src/CountdownLatch.ts +24 -13
  542. package/_src/Fiber/FiberRuntime.ts +4 -2
  543. package/_src/FiberRef/definition.ts +1 -1
  544. package/_src/Hub/api.ts +85 -54
  545. package/_src/Hub/internal.ts +36 -20
  546. package/_src/IO/api/foreachExec.ts +47 -0
  547. package/_src/IO/api.ts +0 -5
  548. package/_src/Push/Bounds.ts +4 -0
  549. package/_src/Push/FlattenStrategy.ts +137 -0
  550. package/_src/Push/IndexedBuffer.ts +79 -0
  551. package/_src/Push/MergeStrategy.ts +59 -0
  552. package/_src/Push/Operator/IOLoopOperator.ts +413 -0
  553. package/_src/Push/Operator/IOOperator.ts +173 -0
  554. package/_src/Push/Operator/LoopOperator.ts +242 -0
  555. package/_src/Push/Operator/SyncOperator.ts +107 -0
  556. package/_src/Push/Operator.ts +7 -0
  557. package/_src/Push/Producer/IOProducer.ts +83 -0
  558. package/_src/Push/Producer/SyncProducer.ts +105 -0
  559. package/_src/Push/Producer.ts +0 -0
  560. package/_src/Push/Sink.ts +302 -0
  561. package/_src/Push/api.ts +389 -515
  562. package/_src/Push/definition.ts +216 -23
  563. package/_src/Push/internal.ts +11 -0
  564. package/_src/Push.ts +7 -1
  565. package/_src/Queue/api/dimapIO.ts +57 -19
  566. package/_src/Queue/api/filterInputIO.ts +36 -12
  567. package/_src/Queue/api/filterOutputIO.ts +42 -18
  568. package/_src/Queue/api/zipWithIO.ts +23 -11
  569. package/_src/Queue/internal.ts +9 -3
  570. package/_src/Ref/Synchronized/definition.ts +81 -37
  571. package/_src/Ref/definition.ts +26 -0
  572. package/_src/Schedule/api.ts +1 -1
  573. package/_src/Scope/api.ts +22 -0
  574. package/_src/ScopedRef/api.ts +6 -2
  575. package/_src/Semaphore/definition.ts +4 -2
  576. package/_src/Sink/definition.ts +4 -5
  577. package/_src/Stream/api.ts +0 -2
  578. package/_src/Stream/definition.ts +0 -1
  579. package/_src/Subject/Atomic.ts +68 -11
  580. package/_src/Subject/DeferredRef.ts +44 -0
  581. package/_src/Subject/Hold.ts +48 -0
  582. package/_src/Subject/RefSubject/Atomic.ts +233 -0
  583. package/_src/Subject/RefSubject/Derived.ts +184 -0
  584. package/_src/Subject/RefSubject/RefSubject.ts +100 -0
  585. package/_src/Subject/RefSubject/constructors.ts +27 -0
  586. package/_src/Subject/RefSubject.ts +7 -0
  587. package/_src/Subject/definition.ts +21 -3
  588. package/_src/Subject.ts +6 -3
  589. package/_src/SubscriptionRef.ts +1 -1
  590. package/_src/Supervisor/constructors.ts +0 -2
  591. package/_src/Supervisor/definition.ts +2 -1
  592. package/_src/TReentrantLock/api.ts +1 -1
  593. package/_src/global.ts +8 -0
  594. package/_src/index.ts +49 -50
  595. package/_src/internal/MutableQueue.ts +5 -3
  596. package/global.d.ts +8 -0
  597. package/index.d.ts +0 -1
  598. package/internal/MutableQueue.d.ts +2 -2
  599. package/package.json +4 -4
  600. package/RefSubject/Atomic.d.ts +0 -34
  601. package/RefSubject/Synchronized/api.d.ts +0 -9
  602. package/RefSubject/Synchronized/definition.d.ts +0 -39
  603. package/RefSubject/api.d.ts +0 -120
  604. package/RefSubject/definition.d.ts +0 -52
  605. package/RefSubject.d.ts +0 -3
  606. package/_cjs/RefSubject/Atomic.cjs +0 -107
  607. package/_cjs/RefSubject/Atomic.cjs.map +0 -1
  608. package/_cjs/RefSubject/Synchronized/api.cjs +0 -22
  609. package/_cjs/RefSubject/Synchronized/api.cjs.map +0 -1
  610. package/_cjs/RefSubject/Synchronized/definition.cjs +0 -55
  611. package/_cjs/RefSubject/Synchronized/definition.cjs.map +0 -1
  612. package/_cjs/RefSubject/api.cjs +0 -251
  613. package/_cjs/RefSubject/api.cjs.map +0 -1
  614. package/_cjs/RefSubject/definition.cjs +0 -26
  615. package/_cjs/RefSubject/definition.cjs.map +0 -1
  616. package/_cjs/RefSubject.cjs +0 -39
  617. package/_cjs/RefSubject.cjs.map +0 -1
  618. package/_mjs/RefSubject/Atomic.mjs +0 -99
  619. package/_mjs/RefSubject/Atomic.mjs.map +0 -1
  620. package/_mjs/RefSubject/Synchronized/api.mjs +0 -15
  621. package/_mjs/RefSubject/Synchronized/api.mjs.map +0 -1
  622. package/_mjs/RefSubject/Synchronized/definition.mjs +0 -47
  623. package/_mjs/RefSubject/Synchronized/definition.mjs.map +0 -1
  624. package/_mjs/RefSubject/api.mjs +0 -229
  625. package/_mjs/RefSubject/api.mjs.map +0 -1
  626. package/_mjs/RefSubject/definition.mjs +0 -19
  627. package/_mjs/RefSubject/definition.mjs.map +0 -1
  628. package/_mjs/RefSubject.mjs +0 -5
  629. package/_mjs/RefSubject.mjs.map +0 -1
  630. package/_src/RefSubject/Atomic.ts +0 -129
  631. package/_src/RefSubject/Synchronized/api.ts +0 -14
  632. package/_src/RefSubject/Synchronized/definition.ts +0 -76
  633. package/_src/RefSubject/api.ts +0 -253
  634. package/_src/RefSubject/definition.ts +0 -70
  635. package/_src/RefSubject.ts +0 -5
package/Push/api.d.ts CHANGED
@@ -1,285 +1,202 @@
1
+ import { Exit } from "@fncts/base/data/Exit/definition";
1
2
  import { Lazy } from "@fncts/base/data/function/definition";
3
+ import { CountdownLatch } from "@fncts/io/CountdownLatch";
4
+ import { Environment } from "@fncts/base/data/Environment/definition";
2
5
  import { Cause } from "@fncts/base/data/Cause/definition";
3
- import { Either } from "@fncts/base/data/Either/definition";
4
- import { Duration } from "@fncts/base/data/Duration/definition";
5
- import { Maybe, Nothing, Just } from "@fncts/base/data/Maybe/definition";
6
- import { Refinement } from "@fncts/base/data/Refinement/definition";
7
6
  import { Predicate } from "@fncts/base/data/Predicate/definition";
8
- import { UIO, URIO } from "@fncts/io/IO/definition";
9
- import { Environment } from "@fncts/base/data/Environment/definition";
10
- import { Fiber } from "@fncts/io/Fiber/definition";
11
- import { Scope } from "@fncts/io/Scope/definition";
12
- import { Conc } from "@fncts/base/collection/immutable/Conc";
13
- import { Future } from "@fncts/io/Future";
14
- import { AtomicReference } from "@fncts/base/internal/AtomicReference";
7
+ import { Refinement } from "@fncts/base/data/Refinement/definition";
8
+ import { Maybe } from "@fncts/base/data/Maybe/definition";
9
+ import { ExecutionStrategy } from "@fncts/base/data/ExecutionStrategy";
10
+ import { Schedule } from "@fncts/io/Schedule/definition";
11
+ import { Layer } from "@fncts/io/Layer";
12
+ import type { MergeStrategy } from "./MergeStrategy.js";
15
13
  import { IO } from "@fncts/io/IO";
16
- import { Push, PushTypeId, PushVariance, Sink } from "./definition.js";
17
- /**
18
- * @tsplus pipeable fncts.io.Push as
19
- * @tsplus location "@fncts/io/Push/api"
20
- */
21
- export declare function as<B>(b: Lazy<B>): <R, E, A>(self: Push<R, E, A>) => Push<R, E, B>;
22
- interface UnsafeSink<E, A> {
23
- event: (value: A) => void;
24
- error: (cause: Cause<E>) => void;
25
- }
14
+ import { Push } from "@fncts/io/Push/definition";
15
+ import { FlattenStrategy } from "@fncts/io/Push/FlattenStrategy";
16
+ import { SyncProducer } from "@fncts/io/Push/Producer/SyncProducer";
17
+ import { Scope } from "@fncts/io/Scope";
18
+ import { type IOProducer } from "./Producer/IOProducer.js";
26
19
  /**
27
- * @tsplus static fncts.io.PushOps asyncInterrupt
20
+ * @tsplus static fncts.io.PushOps bracketExit
28
21
  * @tsplus location "@fncts/io/Push/api"
29
22
  */
30
- export declare function asyncInterrupt<R, E, A>(make: (emitter: UnsafeSink<E, A>) => Either<IO<R, never, void>, Push<R, E, A>>): Push<R, E, A>;
23
+ export declare function bracketExit<R, E, A, R1, E1, B, R2, E2, C>(acquire: IO<R, E, A>, use: (a: A) => Push<R1, E1, B>, release: (a: A, exit: Exit<unknown, unknown>) => IO<R2, E2, C>): Push<R | R1 | R2, E | E1 | E2, B>;
31
24
  /**
32
- * @tsplus static fncts.io.PushOps async
25
+ * @tsplus static fncts.io.PushOps defer
33
26
  * @tsplus location "@fncts/io/Push/api"
34
27
  */
35
- export declare function async<E, A>(make: (sink: UnsafeSink<E, A>) => void): Push<never, E, A>;
28
+ export declare function defer<R, E, A>(self: Lazy<Push<R, E, A>>): Push<R, E, A>;
36
29
  /**
37
30
  * @tsplus static fncts.io.PushOps combineLatest
38
31
  * @tsplus location "@fncts/io/Push/api"
39
32
  */
40
- export declare function combineLatest<A extends ReadonlyArray<Push<any, any, any>>>(streams: [...A]): Push<Push.EnvironmentOf<A[number]>, Push.ErrorOf<A[number]>, {
33
+ export declare function combineLatest<A extends ReadonlyArray<Push<any, any, any>>>(streams: [...A]): Push<Push.EnvironmentOf<A[number]> | Scope, Push.ErrorOf<A[number]>, {
41
34
  [K in keyof A]: Push.ValueOf<A[K]>;
42
35
  }>;
43
- export declare function combineLatest<R, E, A>(streams: Iterable<Push<R, E, A>>): Push<R, E, ReadonlyArray<A>>;
44
- /**
45
- * @tsplus pipeable fncts.io.PushOps combineLatestWith
46
- * @tsplus location "@fncts/io/Push/api"
47
- */
48
- export declare function combineLatestWith<A, R1, E1, B, C>(that: Push<R1, E1, B>, f: (a: A, b: B) => C): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, C>;
49
- /**
50
- * @tsplus pipeable fncts.io.Push debounce
51
- * @tsplus location "@fncts/io/Push/api"
52
- */
53
- export declare function debounce(duration: Lazy<Duration>): <R, E, A>(self: Push<R, E, A>) => Push<R, E, A>;
54
- /**
55
- * @tsplus static fncts.io.PushOps defer
56
- * @tsplus location "@fncts/io/Push/api"
57
- */
58
- export declare function defer<R, E, A>(self: Lazy<Push<R, E, A>>): Push<R, E, A>;
36
+ export declare function combineLatest<R, E, A>(streams: Iterable<Push<R, E, A>>): Push<R | Scope, E, ReadonlyArray<A>>;
59
37
  /**
60
- * @tsplus pipeable fncts.io.Push exhaustMap
38
+ * @tsplus pipeable fncts.io.Push contramapEnvironment
61
39
  * @tsplus location "@fncts/io/Push/api"
62
40
  */
63
- export declare function exhaustMap<A, R1, E1, B>(f: (a: A) => Push<R1, E1, B>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
41
+ export declare function contramapEnvironment<R, R1>(f: (r: Environment<R1>) => Environment<R>): <E, A>(self: Push<R, E, A>) => Push<R1, E, A>;
64
42
  /**
65
- * @tsplus pipeable fncts.io.Push exhaustMapIO
43
+ * @tsplus static fncts.io.PushOps failCause
66
44
  * @tsplus location "@fncts/io/Push/api"
67
45
  */
68
- export declare function exhaustMapIO<A, R1, E1, B>(f: (a: A) => IO<R1, E1, B>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
46
+ export declare function failCause<E>(cause: Lazy<Cause<E>>): Push<never, E, never>;
69
47
  /**
70
- * @tsplus pipeable fncts.io.Push filterIO
48
+ * @tsplus static fncts.io.PushOps failCauseNow
71
49
  * @tsplus location "@fncts/io/Push/api"
72
50
  */
73
- export declare function filterIO<A, R1, E1>(predicate: (a: A) => IO<R1, E1, boolean>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, A>;
51
+ export declare function failCauseNow<E>(cause: Cause<E>): Push<never, E, never>;
74
52
  /**
75
- * @tsplus pipeable fncts.io.Push filterMapIO
53
+ * @tsplus static fncts.io.PushOps failNow
76
54
  * @tsplus location "@fncts/io/Push/api"
77
55
  */
78
- export declare function filterMapIO<A, R1, E1, B>(f: (a: A) => IO<R1, E1, Maybe<B>>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
56
+ export declare function failNow<E>(error: E): Push<never, E, never>;
79
57
  /**
80
58
  * @tsplus pipeable fncts.io.Push filter
81
59
  * @tsplus location "@fncts/io/Push/api"
82
60
  */
83
- export declare function filter<A, B extends A>(refinement: Refinement<A, B>): <R, E>(self: Push<R, E, A>) => Push<R, E, B>;
84
- export declare function filter<A>(predicate: Predicate<A>): <R, E>(self: Push<R, E, A>) => Push<R, E, A>;
61
+ export declare function filter<A, B extends A>(p: Refinement<A, B>): <R, E>(self: Push<R, E, A>) => Push<R, E, B>;
62
+ export declare function filter<A>(p: Predicate<A>): <R, E>(self: Push<R, E, A>) => Push<R, E, A>;
85
63
  /**
86
64
  * @tsplus pipeable fncts.io.Push filterMap
87
65
  * @tsplus location "@fncts/io/Push/api"
88
66
  */
89
- export declare function filterMap<A, B>(f: (a: A) => Maybe<B>): <R, E>(self: Push<R, E, A>) => Push<R, E, B>;
67
+ export declare function filterMap<A, B>(f: (value: A) => Maybe<B>): <R, E>(self: Push<R, E, A>) => Push<R, E, B>;
90
68
  /**
91
- * @tsplus pipeable fncts.io.Push flatMapConcurrentBounded
92
- * @tsplus location "@fncts/io/Push/api"
93
- */
94
- export declare function flatMapConcurrentBounded<A, R1, E1, B>(f: (a: A) => Push<R1, E1, B>, concurrency: number): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
95
- /**
96
- * @tsplus pipeable fncts.io.Push flatMapConcurrentUnbounded
69
+ * @tsplus pipeable fncts.io.Push flatMap
97
70
  * @tsplus location "@fncts/io/Push/api"
98
71
  */
99
- export declare function flatMapConcurrentUnbounded<A, R1, E1, B>(f: (a: A) => Push<R1, E1, B>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
72
+ export declare function flatMap<A, R1, E1, B>(f: (a: A) => Push<R1, E1, B>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
100
73
  /**
101
- * @tsplus pipeable fncts.io.Push flatMapConcurrent
74
+ * @tsplus pipeable fncts.io.Push flatMapUnbounded
102
75
  * @tsplus location "@fncts/io/Push/api"
103
76
  */
104
- export declare function flatMapConcurrent<A, R1, E1, B>(f: (a: A) => Push<R1, E1, B>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
77
+ export declare function flatMapUnbounded<A, R1, E1, B>(f: (a: A) => Push<R1, E1, B>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
105
78
  /**
106
- * @tsplus pipeable fncts.io.Push flatMap
79
+ * @tsplus pipeable fncts.io.Push flatMapWithStrategy
107
80
  * @tsplus location "@fncts/io/Push/api"
108
81
  */
109
- export declare function flatMap<A, R1, E1, B>(f: (a: A) => Push<R1, E1, B>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
82
+ export declare function flatMapWithStrategy<A, R1, E1, B>(f: (a: A) => Push<R1, E1, B>, flattenStrategy: FlattenStrategy, executionStrategy: ExecutionStrategy): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
110
83
  /**
111
- * @tsplus getter fncts.io.Push flatten
84
+ * @tsplus static fncts.io.PushOps fromArray
112
85
  * @tsplus location "@fncts/io/Push/api"
113
86
  */
114
- export declare function flatten<R, E, R1, E1, A>(self: Push<R, E, Push<R1, E1, A>>): Push<R | R1, E | E1, A>;
87
+ export declare function fromArray<A extends ReadonlyArray<any>>(array: A): Push<never, never, A[number]>;
115
88
  /**
116
89
  * @tsplus static fncts.io.PushOps fromIO
117
90
  * @tsplus location "@fncts/io/Push/api"
118
91
  */
119
- export declare function fromIO<R, E, A>(io: Lazy<IO<R, E, A>>): Push<R, E, A>;
92
+ export declare function fromIO<R, E, A>(io: IO<R, E, A>): Push<R, E, A>;
120
93
  /**
121
- * @tsplus static fncts.io.PushOps fromAsyncIterable
94
+ * @tsplus static fncts.io.PushOps fromIOProducer
122
95
  * @tsplus location "@fncts/io/Push/api"
123
96
  */
124
- export declare function fromAsyncIterable<A>(iterable: AsyncIterable<A>): Push<never, never, A>;
97
+ export declare function fromIOProducer<R, E, A>(producer: IOProducer<R, E, A>): Push<R, E, A>;
125
98
  /**
126
99
  * @tsplus static fncts.io.PushOps fromIterable
127
100
  * @tsplus location "@fncts/io/Push/api"
128
101
  */
129
102
  export declare function fromIterable<A>(iterable: Iterable<A>): Push<never, never, A>;
130
103
  /**
131
- * @tsplus getter fncts.io.Push multicast
132
- * @tsplus location "@fncts/io/Push/api"
133
- */
134
- export declare function multicast<R, E, A>(self: Push<R, E, A>): Push<R, E, A>;
135
- interface MulticastObserver<E, A> {
136
- readonly sink: Sink<any, E, A>;
137
- readonly environment: Environment<any>;
138
- }
139
- export declare class Multicast<R, E, A> implements Push<R, E, A>, Sink<never, E, A> {
140
- readonly push: Push<R, E, A>;
141
- readonly [PushTypeId]: PushTypeId;
142
- [PushVariance]: {
143
- readonly _R: (_: never) => R;
144
- readonly _E: (_: never) => E;
145
- readonly _A: (_: never) => A;
146
- };
147
- protected observers: Array<MulticastObserver<E, A>>;
148
- protected fiber: Fiber<never, unknown> | undefined;
149
- constructor(push: Push<R, E, A>);
150
- run<R1>(sink: Sink<R1, E, A>): IO<R | R1, never, void>;
151
- event(value: A): IO<never, never, void>;
152
- error(cause: Cause<E>): IO<never, never, void>;
153
- protected runValue(value: A, observer: MulticastObserver<E, A>): IO<never, never, void>;
154
- protected runError(cause: Cause<E>, observer: MulticastObserver<E, A>): IO<never, never, void>;
155
- protected removeSink(sink: Sink<any, E, A>): IO<never, never, void>;
156
- }
157
- /**
158
- * @tsplus getter fncts.io.Push hold
159
- * @tsplus location "@fncts/io/Push/api"
160
- */
161
- export declare function hold<R, E, A>(self: Push<R, E, A>): Push<R, E, A>;
162
- export declare class Hold<R, E, A> extends Multicast<R, E, A> {
163
- push: Push<R, E, A>;
164
- readonly current: AtomicReference<import("@fncts/base/data/Maybe.js").Maybe<A>>;
165
- constructor(push: Push<R, E, A>);
166
- run<R1>(sink: Sink<R1, E, A>): IO<R | R1, never, void>;
167
- event(value: A): IO<never, never, void>;
168
- }
169
- /**
170
- * @tsplus pipeable fncts.io.Push map 1
104
+ * @tsplus static fncts.io.PushOps fromScheduled
171
105
  * @tsplus location "@fncts/io/Push/api"
172
106
  */
173
- export declare function map<A, B>(f: (a: A) => B): <R, E>(self: Push<R, E, A>) => Push<R, E, B>;
107
+ export declare function fromScheduled<R, E, I, R1, O>(io: IO<R, E, I>, schedule: Schedule<R1, I, O>): Push<R | R1, E, O>;
174
108
  /**
175
- * @tsplus pipeable fncts.io.Push mapError
109
+ * @tsplus static fncts.io.PushOps fromSyncProducer
176
110
  * @tsplus location "@fncts/io/Push/api"
177
111
  */
178
- export declare function mapError<E, E1>(f: (e: E) => E1): <R, A>(self: Push<R, E, A>) => Push<R, E1, A>;
112
+ export declare function fromSyncProducer<A>(producer: SyncProducer<A>): Push<never, never, A>;
179
113
  /**
180
- * @tsplus pipeable fncts.io.Push mapErrorCause
114
+ * @tsplus static fncts.io.PushOps haltNow
181
115
  * @tsplus location "@fncts/io/Push/api"
182
116
  */
183
- export declare function mapErrorCause<E, E1>(f: (cause: Cause<E>) => Cause<E1>): <R, A>(self: Push<R, E, A>) => Push<R, E1, A>;
184
- /**
185
- * @tsplus pipeable fncts.io.Push mapIO
186
- * @tsplus location "@fncts/io/Push/api"
187
- */
188
- export declare function mapIO<A, R1, E1, B>(f: (a: A) => IO<R1, E1, B>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
117
+ export declare function haltNow(error: unknown): Push<never, never, never>;
189
118
  /**
190
- * @tsplus pipeable fncts.io.Push merge
119
+ * @tsplus static fncts.io.PushOps __call
191
120
  * @tsplus location "@fncts/io/Push/api"
192
121
  */
193
- export declare function merge<R1, E1, B>(that: Push<R1, E1, B>): <R, E, A>(self: Push<R, E, A>) => Push<R | R1, E | E1, A | B>;
122
+ export declare function makePush<R, E, A>(run: <R1>(sink: Push.UnsafeSink<R1, E, A>) => IO<R | R1, never, unknown>): Push<R, E, A>;
194
123
  /**
195
- * @tsplus static fncts.io.PushOps mergeAll
124
+ * @tsplus pipeable fncts.io.Push map
196
125
  * @tsplus location "@fncts/io/Push/api"
197
126
  */
198
- export declare function mergeAll<A extends ReadonlyArray<Push<any, any, any>>>(streams: [...A]): Push<Push.EnvironmentOf<A[number]>, Push.ErrorOf<A[number]>, Push.ValueOf<A[number]>>;
199
- export declare function mergeAll<R, E, A>(streams: Iterable<Push<R, E, A>>): Push<R, E, A>;
127
+ export declare function map<A, B>(f: (a: A) => B): <R, E>(self: Push<R, E, A>) => Push<R, E, B>;
200
128
  /**
201
- * @tsplus pipeable fncts.io.Push observe
129
+ * @tsplus pipeable fncts.io.Push mapAccum
202
130
  * @tsplus location "@fncts/io/Push/api"
203
131
  */
204
- export declare function observe<A, R1, E1>(f: (a: A) => IO<R1, E1, void>, __tsplusTrace?: string): <R, E>(self: Push<R, E, A>) => IO<R | R1 | Scope, E | E1, void>;
132
+ export declare function mapAccum<A, S, B>(seed: S, f: (acc: S, a: A) => readonly [S, B]): <R, E>(self: Push<R, E, A>) => Push<R, E, B>;
205
133
  /**
206
- * @tsplus static fncts.io.PushOps repeatIOMaybe
134
+ * @tsplus pipeable fncts.io.Push mapIO
207
135
  * @tsplus location "@fncts/io/Push/api"
208
136
  */
209
- export declare function repeatIOMaybe<R, E, A>(io: IO<R, Maybe<E>, A>, __tsplusTrace?: string): Push<R, E, A>;
137
+ export declare function mapIO<A, R1, E1, B>(f: (a: A) => IO<R1, E1, B>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
210
138
  /**
211
- * @tsplus getter fncts.io.Push runCollect
139
+ * @tsplus pipeable fncts.io.Push mapIOWithStrategy
212
140
  * @tsplus location "@fncts/io/Push/api"
213
141
  */
214
- export declare function runCollect<R, E, A>(self: Push<R, E, A>): IO<R | Scope, E, Conc<A>>;
142
+ export declare function mapIOWithStrategy<A, R1, E1, B>(f: (a: A) => IO<R1, E1, B>, flattenStrategy: FlattenStrategy, executionStrategy: ExecutionStrategy): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
215
143
  /**
216
- * @tsplus getter fncts.io.Push runDrain
144
+ * @tsplus static fncts.io.PushOps mergeWithStrategy
217
145
  * @tsplus location "@fncts/io/Push/api"
218
146
  */
219
- export declare function runDrain<R, E, A>(self: Push<R, E, A>): IO<R | Scope, E, void>;
147
+ export declare function mergeWithStrategy<Ps extends ReadonlyArray<Push<any, any, any>>>(streams: Ps, mergeStrategy: MergeStrategy): Push<Push.EnvironmentOf<Ps[number]>, Push.ErrorOf<Ps[number]>, Push.ValueOf<Ps[number]>>;
220
148
  /**
221
- * @tsplus static fncts.io.PushOps scoped
149
+ * @tsplus pipeable fncts.io.Push observe
222
150
  * @tsplus location "@fncts/io/Push/api"
223
151
  */
224
- export declare function scoped<R, E, A>(io: Lazy<IO<R, E, A>>, __tsplusTrace?: string): Push<Exclude<R, Scope>, E, A>;
152
+ export declare function observe<A, R1>(f: (a: A) => IO<R1, never, void>): <R, E>(self: Push<R, E, A>) => IO<R | R1, never, void>;
225
153
  /**
226
- * @tsplus static fncts.io.PushOps succeed
154
+ * @tsplus pipeable fncts.io.Push orElseCause
227
155
  * @tsplus location "@fncts/io/Push/api"
228
156
  */
229
- export declare function succeed<A>(value: Lazy<A>): Push<never, never, A>;
157
+ export declare function orElseCause<E, R1, E1, B>(that: (cause: Cause<E>) => Push<R1, E1, B>): <R, A>(self: Push<R, E, A>) => Push<R | R1, E | E1, A | B>;
230
158
  /**
231
- * @tsplus pipeable fncts.io.Push switchMap
159
+ * @tsplus pipeable fncts.io.Push provideEnvironment
232
160
  * @tsplus location "@fncts/io/Push/api"
233
161
  */
234
- export declare function switchMap<A, R1, E1, B>(f: (a: A) => Push<R1, E1, B>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
162
+ export declare function provideEnvironment<R>(environment: Environment<R>): <E, A>(self: Push<R, E, A>) => Push<never, E, A>;
235
163
  /**
236
- * @tsplus pipeable fncts.io.Push switchMapIO
164
+ * @tsplus pipeable fncts.io.Push provideLayer
237
165
  * @tsplus location "@fncts/io/Push/api"
238
166
  */
239
- export declare function switchMapIO<A, R1, E1, B>(f: (a: A) => IO<R1, E1, B>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
167
+ export declare function provideLayer<R1, E1, R2>(layer: Layer<R1, E1, R2>): <R, E, A>(self: Push<R, E, A>) => Push<Exclude<R, R2> | R1, E | E1, A>;
240
168
  /**
241
- * @tsplus pipeable fncts.io.Push tap
169
+ * @tsplus pipeable fncts.io.Push provideSomeEnvironment
242
170
  * @tsplus location "@fncts/io/Push/api"
243
171
  */
244
- export declare function tap<A, R1, E1, B>(f: (a: A) => IO<R1, E1, B>): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, A>;
172
+ export declare function provideSomeEnvironment<R1>(environment: Environment<R1>): <R, E, A>(self: Push<R, E, A>) => Push<Exclude<R, R1>, E, A>;
245
173
  /**
246
- * @tsplus pipeable fncts.io.Push transform
174
+ * @tsplus static fncts.io.PushOps schedule
247
175
  * @tsplus location "@fncts/io/Push/api"
248
176
  */
249
- export declare function transform<R1 = never>(f: <R, E, A>(io: IO<R, E, A>) => IO<R | R1, E, A>): <R, E, A>(self: Push<R, E, A>) => Push<R | R1, E, A>;
177
+ export declare function schedule<R, E, A, R1, O>(io: IO<R, E, A>, schedule: Schedule<R1, unknown, O>): Push<R | R1, E, A>;
250
178
  /**
251
- * @tsplus static fncts.io.PushOps unfold
179
+ * @tsplus static fncts.io.PushOps succeed
252
180
  * @tsplus location "@fncts/io/Push/api"
253
181
  */
254
- export declare function unfold<S, A>(s: S, f: (s: S) => Maybe<readonly [A, S]>): Push<never, never, A>;
182
+ export declare function succeed<A>(value: Lazy<A>): Push<never, never, A>;
255
183
  /**
256
- * @tsplus static fncts.io.PushOps unfoldIO
184
+ * @tsplus static fncts.io.PushOps succeedNow
257
185
  * @tsplus location "@fncts/io/Push/api"
258
186
  */
259
- export declare function unfoldIO<S, R, E, A>(s: S, f: (s: S) => IO<R, E, Maybe<readonly [A, S]>>): Push<R, E, A>;
187
+ export declare function succeedNow<A>(value: A): Push<never, never, A>;
260
188
  /**
261
- * @tsplus pipeable fncts.io.Push untilFuture
189
+ * @tsplus pipeable fncts.io.Push switchMap
262
190
  * @tsplus location "@fncts/io/Push/api"
263
191
  */
264
- export declare function untilFuture<E1, B>(future: Future<E1, B>): <R, E, A>(self: Push<R, E, A>) => Push<R, E | E1, A>;
192
+ export declare function switchMap<A, R1, E1, B>(f: (a: A) => Push<R1, E1, B>, executionStrategy?: ExecutionStrategy): <R, E>(self: Push<R, E, A>) => Push<R | R1, E | E1, B>;
265
193
  /**
266
- * @tsplus pipeable fncts.io.Push untilPush
194
+ * @tsplus pipeable fncts.io.Push transform
267
195
  * @tsplus location "@fncts/io/Push/api"
268
196
  */
269
- export declare function untilPush<R1, E1, B>(signal: Push<R1, E1, B>): <R, E, A>(self: Push<R, E, A>) => Push<R | R1, E | E1, A>;
197
+ export declare function transform<R, R1>(f: (io: IO<R, never, void>) => IO<R1, never, void>): <E, A>(self: Push<R, E, A>) => Push<R | R1, E, A>;
270
198
  /**
271
199
  * @tsplus static fncts.io.PushOps unwrap
272
200
  * @tsplus location "@fncts/io/Push/api"
273
201
  */
274
202
  export declare function unwrap<R, E, R1, E1, A>(io: IO<R, E, Push<R1, E1, A>>): Push<R | R1, E | E1, A>;
275
- /**
276
- * @tsplus static fncts.io.PushOps unwrapScoped
277
- * @tsplus location "@fncts/io/Push/api"
278
- */
279
- export declare function unwrapScoped<R, E, R1, E1, A>(self: IO<R, E, Push<R1, E1, A>>, __tsplusTrace?: string): Push<R1 | Exclude<R, Scope>, E | E1, A>;
280
- /**
281
- * @tsplus static fncts.io.PushOps never
282
- * @tsplus location "@fncts/io/Push/api"
283
- */
284
- export declare const never: Push<never, never, never>;
285
- export {};
@@ -1,24 +1,43 @@
1
1
  import { IO } from "@fncts/io/IO/definition";
2
2
  import { Cause } from "@fncts/base/data/Cause/definition";
3
+ import { ExecutionStrategy } from "@fncts/base/data/ExecutionStrategy";
4
+ import type { Sink as Sink_, UnsafeSink, UnsafeSink as UnsafeSink_ } from "./Sink.js";
5
+ import type { FlattenStrategy } from "@fncts/io/Push/FlattenStrategy";
6
+ import type { IOProducer } from "@fncts/io/Push/Producer/IOProducer";
7
+ import { type SyncProducer } from "@fncts/io/Push/Producer/SyncProducer";
3
8
  export declare const PushVariance: unique symbol;
4
9
  export type PushVariance = typeof PushVariance;
5
10
  export declare const PushTypeId: unique symbol;
6
11
  export type PushTypeId = typeof PushTypeId;
12
+ export declare const enum PushTag {
13
+ Defer = 0,
14
+ ProducerSync = 1,
15
+ ProducerIO = 2,
16
+ FailCause = 3,
17
+ OnSuccess = 4,
18
+ OnSuccessWithStrategy = 5,
19
+ OnSuccessAndFailure = 6,
20
+ External = 7,
21
+ FromPush = 8,
22
+ Transform = 9
23
+ }
7
24
  /**
8
25
  * @tsplus type fncts.io.Push
9
26
  * @tsplus companion fncts.io.PushOps
10
27
  */
11
- export declare class Push<R, E, A> {
12
- readonly run: <R1>(emitter: Sink<R1, E, A>) => IO<R | R1, never, unknown>;
28
+ export declare abstract class Push<R, E, A> {
13
29
  readonly [PushTypeId]: PushTypeId;
30
+ readonly _pushOpCode: PushTag | null;
14
31
  [PushVariance]: {
15
32
  readonly _R: (_: never) => R;
16
33
  readonly _E: (_: never) => E;
17
34
  readonly _A: (_: never) => A;
18
35
  };
19
- constructor(run: <R1>(emitter: Sink<R1, E, A>) => IO<R | R1, never, unknown>);
36
+ constructor();
37
+ run<R1>(sink: UnsafeSink<R1, E, A>): IO<R | R1, never, void>;
20
38
  }
21
39
  export declare namespace Push {
40
+ type Run<R, E, A> = <R1>(emitter: UnsafeSink<R1, E, A>) => IO<R | R1, never, unknown>;
22
41
  type EnvironmentOf<X> = [X] extends [{
23
42
  [PushVariance]: {
24
43
  readonly _R: (_: never) => infer R;
@@ -34,23 +53,77 @@ export declare namespace Push {
34
53
  readonly _A: (_: never) => infer A;
35
54
  };
36
55
  }] ? A : never;
56
+ type Sink<Env, R, E, A> = Sink_<Env, R, E, A>;
57
+ type UnsafeSink<R, E, A> = UnsafeSink_<R, E, A>;
37
58
  }
38
59
  /**
39
- * @tsplus type fncts.io.Push.Sink
40
- * @tsplus companion fncts.io.Push.SinkOps
41
- */
42
- export declare class Sink<R, E, A> {
43
- readonly event: (value: A) => IO<R, never, void>;
44
- readonly error: (cause: Cause<E>) => IO<R, never, void>;
45
- constructor(event: (value: A) => IO<R, never, void>, error: (cause: Cause<E>) => IO<R, never, void>);
46
- }
47
- /**
48
- * @tsplus static fncts.io.PushOps __call
60
+ * @tsplus pipeable fncts.io.Push unsafeRun
49
61
  * @tsplus location "@fncts/io/Push/definition"
50
62
  */
51
- export declare function makePush<R, E, A>(run: <R1>(sink: Sink<R1, E, A>) => IO<R | R1, never, unknown>): Push<R, E, A>;
52
- /**
53
- * @tsplus static fncts.io.Push.SinkOps __call
54
- * @tsplus location "@fncts/io/Push/definition"
55
- */
56
- export declare function makeSink<R, E, A>(value: (value: A) => IO<R, never, unknown>, error: (cause: Cause<E>) => IO<R, never, unknown>): Sink<R, E, A>;
63
+ export declare function unsafeRun<E, A, R1>(sink: UnsafeSink<R1, E, A>): <R>(push: Push<R, E, A>) => IO<R | R1, never, void>;
64
+ export type PushOp<Tag extends string | number | null, Body = {}> = Push<never, any, any> & Body & {
65
+ readonly _pushOpCode: Tag;
66
+ };
67
+ export declare class PushPrimitive extends Push<never, any, any> {
68
+ readonly _pushOpCode: PushTag | null;
69
+ i0: any;
70
+ i1: any;
71
+ i2: any;
72
+ i3: any;
73
+ i4: any;
74
+ trace: string | undefined;
75
+ constructor(_pushOpCode: PushTag | null);
76
+ }
77
+ export interface Base<R = never, E = any, A = any> extends PushOp<null, {
78
+ readonly run: Push.Run<R, E, A>;
79
+ }> {
80
+ }
81
+ export interface Defer extends PushOp<PushTag.Defer, {
82
+ readonly i0: () => Primitive;
83
+ }> {
84
+ }
85
+ export interface FromPush<R = never, E = any, A = any> extends PushOp<PushTag.FromPush, {
86
+ readonly i0: Push.Run<R, E, A>;
87
+ }> {
88
+ }
89
+ export interface ProducerSync<A = any> extends PushOp<PushTag.ProducerSync, {
90
+ readonly i0: SyncProducer<A>;
91
+ }> {
92
+ }
93
+ export interface ProducerIO<R = never, E = any, A = any> extends PushOp<PushTag.ProducerIO, {
94
+ readonly i0: IOProducer<R, E, A>;
95
+ }> {
96
+ }
97
+ export interface Fail<E = any> extends PushOp<PushTag.FailCause, {
98
+ readonly i0: () => Cause<E>;
99
+ }> {
100
+ }
101
+ export interface OnSuccess<A = any> extends PushOp<PushTag.OnSuccess, {
102
+ readonly i0: Primitive;
103
+ readonly i1: (a: A) => Primitive;
104
+ }> {
105
+ }
106
+ export interface OnSuccessWithStrategy<A = any> extends PushOp<PushTag.OnSuccessWithStrategy, {
107
+ readonly i0: Primitive;
108
+ readonly i1: (a: A) => Primitive;
109
+ readonly i2: FlattenStrategy;
110
+ readonly i3: ExecutionStrategy;
111
+ }> {
112
+ }
113
+ export interface OnSuccessAndFailure<E = any, A = any> extends PushOp<PushTag.OnSuccessAndFailure, {
114
+ readonly i0: Primitive;
115
+ readonly i1: (cause: Cause<E>) => Primitive;
116
+ readonly i2: (a: A) => Primitive;
117
+ readonly i3: FlattenStrategy;
118
+ readonly i4: ExecutionStrategy;
119
+ }> {
120
+ }
121
+ export interface Transform extends PushOp<PushTag.Transform, {
122
+ i0: Primitive;
123
+ i1: (io: IO<any, any, any>) => IO<any, never, void>;
124
+ }> {
125
+ }
126
+ type Primitive = Base | ProducerSync | ProducerIO | Fail | OnSuccess | OnSuccessWithStrategy | OnSuccessAndFailure | FromPush | Defer | Transform;
127
+ export declare function concrete(push: Push<any, any, any>): asserts push is Primitive;
128
+ export declare function unsafeRunPush(push: Push<any, any, any>, sink: UnsafeSink<any, any, any>): IO<any, never, void>;
129
+ export {};
@@ -1,6 +1,9 @@
1
+ import { Scope } from "@fncts/io/Scope/definition";
1
2
  import { IO, URIO } from "@fncts/io/IO/definition";
3
+ import { ExecutionStrategy } from "@fncts/base/data/ExecutionStrategy";
2
4
  import { Fiber } from "@fncts/io/Fiber/definition";
3
5
  import type { RuntimeFiber } from "@fncts/io/Fiber";
6
+ export declare function withScope<R, E, A>(f: (scope: Scope.Closeable) => IO<R, E, A>, executionStrategy: ExecutionStrategy): IO<R | Scope, E, A>;
4
7
  export declare function withScopedFork<R, E, A>(f: (fork: <R, E, A>(io: IO<R, E, A>) => IO<R, never, RuntimeFiber<E, A>>) => IO<R, E, A>): IO<R, E, A>;
5
8
  export declare function withSwitch<R, E, A>(f: (fork: <R>(io: URIO<R, void>) => URIO<R, void>) => IO<R, E, A>): import("../IO").IO<R, E, void>;
6
9
  export declare function withUnboundedConcurrency<R, E, A>(f: (fork: <R>(io: URIO<R, void>) => URIO<R, RuntimeFiber<never, void>>) => IO<R, E, A>): import("../IO").IO<R, E, void>;
package/Push.d.ts CHANGED
@@ -1,3 +1,9 @@
1
1
  export * from "./Push/api.js";
2
+ export * from "./Push/Bounds.js";
2
3
  export * from "./Push/definition.js";
4
+ export * from "./Push/FlattenStrategy.js";
5
+ export * from "./Push/IndexedBuffer.js";
3
6
  export * from "./Push/internal.js";
7
+ export * from "./Push/MergeStrategy.js";
8
+ export * from "./Push/Operator.js";
9
+ export * from "./Push/Producer.js";
@@ -57,15 +57,15 @@ declare class ContramapIO<RA, RB, EA, EB, A, B, RC, EC, C> implements PEnqueueIn
57
57
  readonly _B: (_: never) => B;
58
58
  };
59
59
  constructor(queue: PEnqueueInternal<RA, RB, EA, EB, A, B>, f: (c: C) => IO<RC, EC, A>);
60
- awaitShutdown: UIO<void>;
61
- capacity: number;
62
- isShutdown: UIO<boolean>;
60
+ get awaitShutdown(): UIO<void>;
61
+ get capacity(): number;
62
+ get isShutdown(): UIO<boolean>;
63
63
  get unsafeSize(): Maybe<number>;
64
64
  unsafeOffer(a: C): boolean;
65
65
  offer(c: C): IO<RC | RA, EA | EC, boolean>;
66
66
  offerAll(cs: Iterable<C>): IO<RC | RA, EC | EA, boolean>;
67
- shutdown: UIO<void>;
68
- size: UIO<number>;
67
+ get shutdown(): UIO<void>;
68
+ get size(): UIO<number>;
69
69
  }
70
70
  /**
71
71
  * Transforms elements enqueued into this queue with an effectful function.
@@ -87,15 +87,15 @@ declare class MapIO<RA, RB, EA, EB, A, B, RC, EC, C> implements PDequeueInternal
87
87
  readonly _B: (_: never) => C;
88
88
  };
89
89
  constructor(queue: PDequeueInternal<RA, RB, EA, EB, A, B>, f: (b: B) => IO<RC, EC, C>);
90
- awaitShutdown: UIO<void>;
91
- capacity: number;
92
- isShutdown: UIO<boolean>;
93
- shutdown: UIO<void>;
94
- size: UIO<number>;
90
+ get awaitShutdown(): UIO<void>;
91
+ get capacity(): number;
92
+ get isShutdown(): UIO<boolean>;
93
+ get shutdown(): UIO<void>;
94
+ get size(): UIO<number>;
95
95
  get unsafeSize(): Maybe<number>;
96
96
  unsafeOffer(a: C): boolean;
97
- take: IO<RB | RC, EB | EC, C>;
98
- takeAll: IO<RB | RC, EB | EC, Conc<C>>;
97
+ get take(): IO<RB | RC, EB | EC, C>;
98
+ get takeAll(): IO<RB | RC, EB | EC, Conc<C>>;
99
99
  takeUpTo(n: number): IO<RB | RC, EB | EC, Conc<C>>;
100
100
  }
101
101
  /**