smol-rs / async-compat

Compatibility adapter between tokio and futures
Apache License 2.0
156 stars 12 forks source link

Use already initialized Tokio runtime #1

Closed oblique closed 4 years ago

oblique commented 4 years ago

If the future is polled after the tokio runtime is initialized, then it will use the already initialized runtime. Otherwise it will spawn a new one as before.

oblique commented 4 years ago

Ok, maybe this is not a good idea because if current runtime is dropped at some point, everything will stop working. I'm closing the PR.