#loop #easy #tokio #core #handle

tk-easyloop

A thread local loop and other loop helpers

2 releases

0.1.1 Jan 30, 2017
0.1.0 Jan 6, 2017

#407 in Asynchronous

22 downloads per month
Used in 6 crates

MIT/Apache

9KB
56 lines

Tokio Easy Loop

Status:Beta
Documentation:http://docs.rs/tk-easyloop/

A main loop wrapper around tokio to provide thread-local loop which:

  • Avoids padding a Handle in to every function
  • Mostly avoids common error: thread 'foo' panicked at 'no Task is currently running', by providing convenient run function for all your code involving futures

Example

Multi-threaded Example

This crate uses thread-local storage for storing loop, but it doesn't mean multi-treading doesn't work. Multiple threads can be used too.

See examples/multi-threaded.rs for more comprehensive example.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~3.5MB
~62K SLoC