You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similarly, `wrapIterator(it: Iterator<T> | AsyncIterator<T>): AsyncIterator<T>` takes an Iterator or AsyncIterator and returns an AsyncIterator that yields the same values but limited in concurrency by this Governor.
73
+
74
+
There are also static helpers for composing Governors: `Governor.any` and `Governor.all`. `any` takes 0 or more Governors and produces a Governor that, when acquired, attempts to acquire all of the passed Governors, returns the first GovernorToken it receives, and releases any other tokens it acquires. `all` takes 0 or more Governors and produces a Governor that attempts to acquire all of the passed Governors and only returns a GovernorToken once it has received a token for each of them.
73
75
</details>
74
76
75
77
#### Open Questions
76
78
77
-
- should the protocol be Symbol-based?
79
+
- should the acquire protocol be Symbol-based?
78
80
- maybe a sync/throwing acquire?
79
81
-`tryAcquire(): GovernorToken`
80
82
- or maybe not throwing? `tryAcquire(): GovernorToken | null`
0 commit comments