Public APIs should not use futures, replace with async/await
ktoso opened this issue · comments
we just noticed that public APIs still are using event loop futures, e.g.:
try otel.start().wait()
InstrumentationSystem.bootstrap(otel.tracer())
Futures should not appear in public APIs, prefer deprecating those immediately and replacing with async
functions -- even if internally they just wait on the same event loop future.
Thanks for bringing this up 🙏 I'm working on a significant refactor of swift-otel
that removes NIO from all public APIs, making it an implementation detail. This refactor will result in a 1.0 release, so I'll add this issue to the 1.0 milestone for now.
I don't think we necessarily need an in-between release to wrap the public API if it breaks soon after.
Sweet!