Comments (2)
Hey @bcgianni ! I've been digging into the Cloud Tasks API docs (both REST and gRPC) once again and it seems that Cloud Task does not provide a way to create tasks in bulk at this stage.
The batch capability of Cloudtasker won't really give you an edge here considering it enqueues jobs sequentially.
From there you have several options:
Option 1: sequential enqueuing
Assuming you have an array of [WorkerClass, args]
, you can simply do something like this:
job_list.each { |(klass, args)| klass.perform_async(*args) }
If you prefer you can also initialize the workers with MyWorker.new(job_args: args)
then invoke schedule
on them.
job_list.each(&:schedule)
Option 2: use a gem like parallel
Taking the first example above, you should be able to do:
Parallel.each(job_list) { |(klass, args)| klass.perform_async(*args) }
I haven't tried it but it should work just fine. In any case, feel free to reply here with any issue you find!
from cloudtasker.
Thank you @alachaum for the answer, that is exactly the way we went with, and it has worked pretty well actually.
Phenomenal job on the lib and documentation btw, we didn't have any issues to have it rolling in just a few days.
from cloudtasker.
Related Issues (20)
- SSL on Cloudtasker Local Server
- Question: configure processor_host via environment variable HOT 5
- Batch callback that fires only when all children complete successfully
- Odd error on boot HOT 3
- default isn't the only default queue if using active job HOT 1
- TypeError: wrong argument type Symbol (expected String) HOT 6
- ActionController::InvalidAuthenticityToken for Cloudtasker::WorkerController#run HOT 11
- Inconsistent executions count with ActiveJob.retry_on HOT 7
- Configure a specific processor_host for Cloudtasker::Cron::Schedule HOT 3
- grpc cannot be used before and after forking with `deliver_later` HOT 5
- Cloudtasker::Cron::Schedule crash application load when schedule tasks due date is 720 hours in the future HOT 2
- Remove `google-gax` dependency. HOT 3
- Post-install message from google-gax HOT 4
- Cloudtasker::Cron::Schedule trying to access wrong project and queue - not respecting initializer configuration HOT 4
- [Question/docs] How is the GCP project id retrieved when running on GCP? HOT 3
- Make Queue Prefix not necessary HOT 1
- Getting a cryptic error on boot HOT 3
- Force the job_id for ActiveJob
- Protobuf serialization errors: ArgumentError (Value 600 must be a Hash or a Google::Protobuf::Duration) HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudtasker.