trio icon indicating copy to clipboard operation
trio copied to clipboard

Add collection of worked examples to tutorial

Open njsmith opened this issue 6 years ago • 43 comments

We should refactor the tutorial into an initial part that's similar to what we have now, or the middle part of my talk, and then a collection of examples that also serve as excuses to go into more depth on particular topics.

I expect the list will grow over time, but here are some ideas. (Actually the main reason I'm filing this is to have a place collect these so I don't lose them.)

  • The current tracing demo should move here. It's a good intro to trio introspection and to co-op concurrency, but having it in the main tutorial like it is now is a big blob of text for folks to wade through if they already know this stuff. (We can/should link to it from the async/await intro though.)

  • Happy eyeballs (for people who saw the talk but want a text version; as a demo of passing nursery objects around; ...)

  • Multiplexing rpc (#467)

  • Catch-all exception handler

  • Custom nursery, like a race function or ignore-errors nursery (maybe both)

  • Some standard stuff like echo server, proxy, fast web spider, ... Whatever doesn't end up in the main tutorial. (We could have echo server and TCP proxy as two examples, then show how to run them both within a single process as an example of implementing multi-protocol servers... and also to show off how proxy_one_way can be re-used for both! Maybe the proxy should demonstrate mirroring localhost:12345 to httpbin:80, so people can try it out with their web browsers?)

  • trio-asyncio example?

  • nursery.start

Possibly some of these could be combined or form sequences, eg echo server -> catch all handler -> nursery.start

njsmith avatar Mar 16 '18 19:03 njsmith