Background worker jobs with loopback models

1,220 views
Skip to first unread message

Satyadeep Karnati

unread,
Jul 31, 2015, 9:25:48 AM7/31/15
to LoopbackJS
We are migrating from Parse.com to Loopback and looking for a way to handle background jobs that can read and process loopback models.
Usecase: mainly for sending SMS, email, processing daily reports and other long running operations.

1. Do you suggest any job queues that can be integrated with loopack?
2. How do we access loopback model methods like Model.create() etc from the worker jobs running on a different server ?

Raymond Feng

unread,
Jul 31, 2015, 1:16:25 PM7/31/15
to loopb...@googlegroups.com
https://github.com/Automattic/kue seems to be reasonable choice. In the task, you can always access LoopBack models using app.models.MyModel.

Thanks,

---
Raymond Feng
Co-Founder and Architect @ StrongLoop, Inc.

StrongLoop makes it easy to develop APIs in Node, plus get DevOps capabilities like monitoring, debugging and clustering.

--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/8e9495f2-ad0a-4cbb-9653-ca2ba1664632%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pulkit Singhal

unread,
Aug 1, 2015, 9:17:11 AM8/1/15
to loopb...@googlegroups.com
I use loopback to submit a task to a worker queue and for the actual worker infrastructure i'm using a hosted solution known as Iron.io

Here's a brief article on how I switched from Parse background jobs to Iron.io:

1) I post a job to the IronWorker queue
2) The IronWorker uses loopback models and strongloop remoting to run code that is syntactically very similar to the code written on the loopback side ... it basically crunches data then saves the data using loopback api or makes some reads if it needs to etc
3) on my loopback UI client, folks can click a job row to submit a task update request to the iron.io api or simply check the loopback model to see if the results have maybe been saved back by the IronWorker already

Also my worker code is open source so you can use that for reference and mimic it if you'd like:
it uses both iron.io and loopback

Satyadeep Karnati

unread,
Aug 3, 2015, 2:30:59 AM8/3/15
to LoopbackJS
Thanks for your response Raymond.
Do you recommend using Kue in the same loopback process? Or shall I implement in a different server and connect to loopback through strong remoting?
Reply all
Reply to author
Forward
0 new messages