slog-rs / async

Asynchronous drain for slog-rs v2
Apache License 2.0
28 stars 24 forks source link

Replace crossbeam with std::sync::mpsc #18

Open davidiw opened 4 years ago

davidiw commented 4 years ago

We're exploring options in the logging space. I was curious how amenable you folks would be to using std::sync::mpsc::sync_channel in favor of crossbeam?

dpc commented 4 years ago

Why? We've just changed to crossbeam cuz it's better.

davidiw commented 4 years ago

In our attempt to minimize our dependencies :). I'm curious to learn more from your perspective.

vorner commented 4 years ago

Wouldn't you just go without slog-async altogether? I mean, if you're minimizing dependencies for some particular reason, then having asynchronous logging might be something you could live without and log synchronously. If you really need async logging, you're probably already writing something „big“ and the chance something else will pull crossbeam-channel is quite high IMO.

I guess it would be possible to have crossbeam as a feature flag, though. It would complicate the code a little bit (they don't have the exact same interface), but should be technically possible. No idea if it's worth it.

dpc commented 4 years ago

At some point crossbeam-channel will maybe become std::sync::mpsc, and we can switch back.

AFAIK crossbeam-channel is considerably better in terms of performance, and if anyone is using slog-async, I think that what they primary want (otherwise why bother with async at all).

Thanks for slog modular nature, there's really nothing stopping anyone from copy pasting slog-async source code into their own code and switching the queue too. Totally feasible: it's simple and tiny.

Geobert commented 2 years ago

On a related note, according to cargo-audit, crossbeam-channel version 0.5.3 has been yanked