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

[Docs]: Polyglot/ python workers for background jobs #11541

Open
1 task
lintfail opened this issue Sep 13, 2024 · 2 comments
Open
1 task

[Docs]: Polyglot/ python workers for background jobs #11541

lintfail opened this issue Sep 13, 2024 · 2 comments

Comments

@lintfail
Copy link

lintfail commented Sep 13, 2024

Summary and description

I'd assume it's a fairly common pattern to have the "web/api" portion of the app written in redwoodjs and have background processing done in python (eg: for AI workloads).

At the moment, we possibly could expose a HTTP endpoint that can be hit + waited on by a redwoodjs worker, but it would be great to have a way to have python workers consume and finish jobs scheduled within redwoodjs.

Are you interested in working on this?

  • I'm interested in working on this
@lintfail
Copy link
Author

@Josh-Walker-GM / @thedavidprice Any thoughts on adding some documentation around this? I'm happy to contribute if there's a preferred way to achieve this

@Josh-Walker-GM
Copy link
Collaborator

Hi @lintfail!

It's a totally reasonable request. I can certainly imagine wanting to run tasks outside of node either because a different language allows the functionality to be implemented more ergonomically or simply because of different library support. I think we'd be happy to have an example on the docs highlighting that this is possible and a description of how to achieve this.

In my head to perform jobs outside of the current redwood worker you'd need your python worker to understand that:

  1. Your adapter and underlying storage that you're scheduling your jobs into. For example the prisma adapter stores jobs into a database table with specific columns and data format.
  2. Your worker needs to be able to take from, work on and update the same storage - eg it should be able to read from, lock, and update that database table prisma would be talking to.

It's been a while since I've worked in python so I wouldn't be swift in implementing an example. Is that something you'd be interested in doing? Implementing a python worker that processes jobs using the database backed jobs? I think a minimal working example would be the next step and then from that we could update the docs to describe what was needed to implement that and indeed point to it as an example. Does that sound reasonable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

2 participants