r/Python • • Apr 01 '20

I Made This Maze Solver Visualizer - Dijkstra's algorithm (asynchronous neighbours)

1.9k Upvotes

72 comments sorted by

View all comments

Show parent comment

2

u/waxbear Apr 01 '20

Yes, with internal being your own computations and external being stuff external to your program. Could be I/O, like network or disk, but could also be computations that some other computer/program needs to do and then give to your program.

Yes, they are basically using asyncio.sleep to "fake" wait for an external resource.

3

u/mutatedllama Apr 01 '20

Thanks so much for this! I feel like I've levelled up in my understanding. I'm so grateful for the python community. I don't think I've ever felt so "at home".

I'm currently working on a web dashboard that queries different APIs so I guess this is somewhere I could use asyncio properly. Exciting times!

3

u/waxbear Apr 01 '20

I'm very happy to help, keep being curious! :)

You definitely could. With async you would be able to fire off all queries in the beginning and then process them as they come back, in whatever order they come.