-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Turbocharged.Beanstalk is a .NET client for Beanstalk, an outrageously simple job queue.
Just about everything in Turbocharged.Beanstalk returns a Task<T>
and is meant to play quite nicely with C#'s async/await keywords.
The rules of the road:
-
Producers are meant for inserting jobs, consumers are meant for reserving jobs.
-
An
IProducer
can be shared among many callers. Producer calls do not block. -
An
IConsumer
can be shared, but be aware that a call toReserveAsync
will block future calls on the connection until:- A job is reserved
- The server responds with DEADLINE_SOON (ReserveAsync returns null)
- The reserve command times out (
ReserveAsync
throws aTimeoutException
)
-
A worker is a dedicated TCP connection which reserves jobs in a loop. A worker is created with a delgate with signature
Func<IWorker, Job, Task>
. As soon a job is reserved, the delegate is called. The delegate is responsible for callingIWorker.DeleteAsync()
to delete the job. You dispose the worker to stop the connection.