This seems to be a thin abstraction over Channels, I'd probably prefer to use Channels directly in almost all cases.
I really like Channels for in-memory queues like this, they're very nice and it's easy to make everything parallel. But if you need more than this you usually need persistence, and then you need something else entirely.
It is a thin abstraction over Channels, and that’s by design. What it adds is graceful shutdown handling, OpenTelemetry integration, timeout support, and simple configuration. I kept needing those pieces in almost every project, so wrapping them up into a small reusable library felt worthwhile.
Under the hood, BusyBee consists of an in-memory queue built on Channels and a job processor that dequeues and executes tasks. The processor is essentially a BackgroundService, but BusyBee wires everything together for you, so you don’t have to manually set up the queue, parallel processing, timeouts and errors handling and observability for OpenTelemetry.
BusyBee is a high-performance .NET background processing library built on native channels. It provides a simple, configurable, and observable solution for handling background tasks with built-in OpenTelemetry support and flexible queue management.
You have no control over concurrency/scheduling, have to manage scoping, error handling, etc. TPL/Threads add to much low level noise to the logic.
Like you could easily blow up the thread pool depending on what you are doing, where a channel based implementation would just deal with spillover and not affect the other threads. You can easily capture scoped services that are disposed by the time the thread executes - but you never catch it in dev because you get executed immediately and request takes long enough, etc.
Spawning threads will work but I can see the use in a small abstraction like this lib for sure. Not sure I would use a lib for this - would probably hand roll something since I don't like adding unvetted external deps by default.
Hangfire is primarily a job scheduler. It is designed for running jobs at specific times or intervals, and it persists jobs in a database so they survive restarts. It comes with a dashboard, retries, and a lot of infrastructure around long‑term job management. That makes it powerful, but also heavier in terms of setup and overhead.
BusyBee is focused on lightweight background processing. Everything is in‑memory, with no external storage required. It is designed for scenarios where you want to enqueue a task and have it executed immediately in the background, without scheduling or persistence.
A practical example: if you are building an API that accepts file uploads and you want to process the file asynchronously after the request returns, BusyBee is a good fit. You just enqueue the job and it runs in the background right away. If instead you need to schedule a nightly cleanup job or ensure jobs survive application restarts, Hangfire would be the better choice.
fabian2k|6 months ago
I really like Channels for in-memory queues like this, they're very nice and it's easy to make everything parallel. But if you need more than this you usually need persistence, and then you need something else entirely.
mikasjp|6 months ago
theryan|6 months ago
mikasjp|6 months ago
rubenvanwyk|6 months ago
mikasjp|6 months ago
bob1029|6 months ago
Why do we need to serialize the jobs through a Channel<T>? Couldn't we just do Task.Run and let the runtime take care of scheduling our work?
rafaelmn|6 months ago
Like you could easily blow up the thread pool depending on what you are doing, where a channel based implementation would just deal with spillover and not affect the other threads. You can easily capture scoped services that are disposed by the time the thread executes - but you never catch it in dev because you get executed immediately and request takes long enough, etc.
Spawning threads will work but I can see the use in a small abstraction like this lib for sure. Not sure I would use a lib for this - would probably hand roll something since I don't like adding unvetted external deps by default.
lloydatkinson|6 months ago
klysm|6 months ago
amir734jj|6 months ago
mikasjp|6 months ago
BusyBee is focused on lightweight background processing. Everything is in‑memory, with no external storage required. It is designed for scenarios where you want to enqueue a task and have it executed immediately in the background, without scheduling or persistence.
A practical example: if you are building an API that accepts file uploads and you want to process the file asynchronously after the request returns, BusyBee is a good fit. You just enqueue the job and it runs in the background right away. If instead you need to schedule a nightly cleanup job or ensure jobs survive application restarts, Hangfire would be the better choice.
rubenvanwyk|6 months ago