dependabot-preview[bot] on pip
Bump pytest from 6.1.2 to 6.2.2… (compare)
dependabot-preview[bot] on pip
dependabot-preview[bot] on master
Bump coverage from 5.3.1 to 5.4… Merge pull request #1880 from p… (compare)
dependabot-preview[bot] on pip
dependabot-preview[bot] on master
Bump urllib3 from 1.26.2 to 1.2… Merge pull request #1879 from p… (compare)
dependabot-preview[bot] on pip
Bump coverage from 5.3.1 to 5.4… (compare)
dependabot-preview[bot] on pip
Bump urllib3 from 1.26.2 to 1.2… (compare)
dependabot-preview[bot] on pip
dependabot-preview[bot] on master
Bump coverage from 5.3.1 to 5.4… Merge pull request #277 from py… (compare)
NoneType
issues solve. I changed what I was doing and it didn't crop up again. I'll open an issue for the proc kill thing. As for my use of conditions: I'm really unsure how to use condition in async code. In threaded coded, I'd lock over shared data, but in async if you don't have to await while touching shared data, do you need to hold the condition (or the underlying lock?).
Condition
s: they're pretty tricky to use! You're right that you don't necessarily need to lock your data to prevent race conditions, because so many operations in async code are automatically atomic. (Though you still might want to use locking just to be explicit and avoid having to think too hard about which operations are atomic and which ones aren't.)
Condition
s, which is that you have to be careful not to miss notifications – if you're not in cond.wait
when someone calls notify
, then you'll never know that it happened. And the lock can sometimes help with this, because taking the lock also blocks anyone else from calling notify
.
print(x)
FdStream
to talk to stdout?
Nursery
" thread, I looked into arboreal terms for "branch point", but decided against suggesting the term they use
Flume
, Canal
, Chute
, Conduit
, Intake
, Siphon
, Orifice
.What's the easiest way to run a bunch of tasks in a given order with at most n
in parallel.
async def main():
async with trio.open_nursery() as nursery:
for i in range(1000):
nursery.start_soon(slow_lookup, i)
In the example, other parts of the code are awaiting for a specific value j
to be mapped to an i
. Lower values of i
are much more likely to map to any j
, so I'd like to start them in order. Does that make sense?
await nursery.start()
because with that the initial step of slow_lookup
must tell the loop that it may proceed with the next i
.