How mikasjp/busybee works
Project type and purpose
• BusyBee is an open-source .NET library for high-performance background job processing.
• It exposes a fluent API for dependency injection, queue configuration, job timeouts, and observability.
Main components
• DemoApp (example client): Web API endpoints that enqueue jobs.
• DI Container: .NET IServiceCollection that wires up BusyBee.
• IBackgroundQueue: abstraction for enqueuing jobs.
• Queue: in-memory channel based queue (bounded or unbounded).
• ProcessorService: background hosted service that pulls jobs.
• JobRunner: executes the job delegate and handles cancellation/timeouts/failures.
• Observability: emits traces & metrics (OpenTelemetry) and logs.
• External systems: OpenTelemetry Collector, Prometheus, Seq/log sink.
Relationships & data flow
• DemoApp HTTP endpoint → enqueues job via IBackgroundQueue
• QueueFactory creates Queue → JobWrapper placed on Channel
• ProcessorService reads from Channel → invokes JobRunner
• JobRunner uses IJobTimeoutHandler/IJobFailureHandler → notifies Observability
• Observability exports metrics/traces to OTEL & logs to Seq
• Prometheus scrapes the metrics endpoint
Architectural highlights
• Dependency Injection: everything registers via AddBusyBee()
• Channel-based Queues: unbounded/bounded with overflow strategies
• Hosted Service Pattern: .NET background service for processing
• Observability: OpenTelemetry instrumentation and Prometheus integration
• Extensibility: pluggable failure/timeout handlers