Dmitry

Results 97 comments of Dmitry

Here is an even easier code to reproduce ```ts import { Effect, Schedule, Stream } from 'effect'; const program = Stream.fromSchedule(Schedule.spaced('1 second')).pipe( Stream.interruptWhen(Effect.never), Stream.take(1), Stream.runCollect, ); Effect.runPromise(program); ```

@mikearnaldi sorry disturbing you, could you please review this PR? This is something i can not implement in userland because most of the implementation logic is located in internals. While...

While the `withReplay` implementation is more flexible, I would prefer having a separate `PubSub.replay` for several reasons. First, `PubSub.replay` uses a Linked List, which makes it faster in terms of...

I think it only makes sense to track replays for `sliding`/`bounded`/`dropping` separately in each of these implementations. So, for `PubSub.sliding({capacity: 5, replay: 10})` we are sliding the real "oldest value"....

I think i have a good idea. We can expose the most efficient API for each use-case. I offered a good (IMHO) implementation for unbounded pubsub replay, which is better...

> I would prefer not to have a replay version of each AtomicPubSub implementation. Yes, of course, i didn't mean that. I just mean that we could use my implementation...

> I ran some benchmarks and they are pretty much the same Yep, i saw that you implemented `ReplayBuffer` based on linked list, and it should be the same from...

> It will just be overhead in terms of the replay buffer nodes, as the actual elements will be the same reference. Yes, it will work for objects, but not...

As far as i understand the JS – each time you pass a primitive to somewhere – you get the new copy of it in memory. https://javascript.info/object-copy

I checked the memory snapshot and i was wrong – it is the same reference