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

Background & scheduled jobs #58

Closed
davewasmer opened this issue May 27, 2016 · 4 comments
Closed

Background & scheduled jobs #58

davewasmer opened this issue May 27, 2016 · 4 comments
Milestone

Comments

@davewasmer
Copy link
Collaborator

The framework should provide a top level abstraction similar to ActiveJob for Rails, where different job backend can plug into the same public API.

@knownasilya
Copy link
Member

Just stumbled on https://github.com/rschmukler/agenda

@acorncom
Copy link
Member

acorncom commented Oct 6, 2016

Re: the above, looks like it's currently not DB-agnostic (Mongo specific atm) but there is some interest in changing that: agenda/agenda#348 No word from the author on that front though ...

I'd be interested in seeing this fleshed out as I could use it for the help wanted app ...

@davewasmer
Copy link
Collaborator Author

Agenda looks interesting. Might be worth investigating the LOE of adding database adapters to it so we could use it.

In general, my thoughts here are:

  • We could take an adapter style approach here (a la Rails ActiveJob), where Denali doesn't know or care how a job is run, it just provides the interface for specifying jobs, and it's up to the user to provide runners.
  • The other approach is that we bake in runners as well, so that Denali will schedule and execute the jobs.

Node's asynchronous model makes things interesting - you could potentially do background process in the same process as the web server. Of course, that exposes you to the risk of a bg job blocking the CPU and thus incoming web requests. So supporting in-process bg jobs might be a nice optional feature, but we'll need some non-blocking answer as well.

It looks like agenda doesn't manage a worker pool either, which is something Denali would need to support. In my past research, I didn't find any single solution for node bg jobs that satisfied everything, but there might be a way we can leverage something like Agenda to get us 70% there.

@acorncom acorncom added this to the v0.2.0 milestone Oct 12, 2016
@davewasmer
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants