Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make IBackgroundJobClient public #61

Closed
odinserj opened this issue Apr 7, 2014 · 1 comment
Closed

Make IBackgroundJobClient public #61

odinserj opened this issue Apr 7, 2014 · 1 comment

Comments

@odinserj
Copy link
Member

odinserj commented Apr 7, 2014

Static methods such as BackgroundJob.Enqueue are good to demonstrate things and for quick starts. But they complicate unit tests and can not be extended using extension methods. Moreover, BackgroundJobClient can be used to batch multiple jobs without creation connection for each.

@odinserj
Copy link
Member Author

odinserj commented Apr 7, 2014

Completed, API looks like BackgroundJob.* methods:

IBackgroundJobClient client = new BackgroundJobClient(); /* There are different overloads */
client.Enqueue(() => Console.WriteLine("Hi"));
client.Schedule(() => Console.WriteLine("Delayed"), TimeSpan.FromMinutes(5));
client.Dispose();

@odinserj odinserj closed this as completed Apr 7, 2014
@odinserj odinserj mentioned this issue Apr 12, 2014
@odinserj odinserj assigned odinserj and unassigned odinserj May 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant