( strategy: PubSub.Strategy<A>, pubsub: PubSub.Atomic<A>, subscribers: PubSub.Subscribers<A>, subscription: PubSub.BackingSubscription<A>, pollers: MutableList.MutableList<Deferred.Deferred<A>> )
| 2635 | } |
| 2636 | |
| 2637 | const strategyCompletePollersUnsafe = <A>( |
| 2638 | strategy: PubSub.Strategy<A>, |
| 2639 | pubsub: PubSub.Atomic<A>, |
| 2640 | subscribers: PubSub.Subscribers<A>, |
| 2641 | subscription: PubSub.BackingSubscription<A>, |
| 2642 | pollers: MutableList.MutableList<Deferred.Deferred<A>> |
| 2643 | ): void => { |
| 2644 | let keepPolling = true |
| 2645 | while (keepPolling && !subscription.isEmpty()) { |
| 2646 | const poller = MutableList.take(pollers) |
| 2647 | if (poller === MutableList.Empty) { |
| 2648 | removeSubscribers(subscribers, subscription, pollers) |
| 2649 | if (pollers.length === 0) { |
| 2650 | keepPolling = false |
| 2651 | } else { |
| 2652 | addSubscribers(subscribers, subscription, pollers) |
| 2653 | } |
| 2654 | } else { |
| 2655 | const pollResult = subscription.poll() |
| 2656 | if (pollResult === MutableList.Empty) { |
| 2657 | MutableList.prepend(pollers, poller) |
| 2658 | } else { |
| 2659 | Deferred.doneUnsafe(poller, Exit.succeed(pollResult)) |
| 2660 | strategy.onPubSubEmptySpaceUnsafe(pubsub, subscribers) |
| 2661 | } |
| 2662 | } |
| 2663 | } |
| 2664 | } |
| 2665 | |
| 2666 | const strategyCompleteSubscribersUnsafe = <A>( |
| 2667 | strategy: PubSub.Strategy<A>, |
no test coverage detected