How to handle external long running tasks, or job queue interoperability

Hey all. New (potential) user here.

Currently running Prisma but unfortunately that doesn’t have realtime and I don’t think it’s in their (immediate) future.

So lets say I have a job queue server running tasks all day. I have external processes putting tasks into the queue and every second the job server is querying the queue and pushing the task to the workers. Each worker runs the job and then signals the queue it’s done and then either executes a webhook or posts a message to a websocket.

How would this process work exactly with Dgraph? Can someone give a detailed explanation?

Many thanks!

Hello @Paul
Dgraph is a graph database and like the other databases there are some operations that are allowed.
Also it offers a GraphQL layer and this GraphQL Layer has the capability of enabling subscription. You can subscribe to the queue with your job queue server and whenever something is changed it’s going to send you the new data.
https://dgraph.io/docs/graphql/subscriptions/#sidebar

For executing a web hook or posting a message you can use Lambda Web Hook and set a hook on update operation(when you enqueue or dequeue) and you can do your custom logic there.
https://dgraph.io/docs/graphql/lambda/webhook/