Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Example usage with Sinatra

Run using the local processing server

  1. Install dependencies: bundle install
  2. Launch the server: foreman start
  3. Open a Sinatra console: ./bin/console
  4. Enqueue workers:
DummyWorker.perform_async

Run using Cloud Tasks

  1. Ensure that your Google Cloud SDK is setup.
  2. Install dependencies: bundle install
  3. Start an ngrok tunnel: ngrok http 3000
  4. Edit the initializer
    • Add the configuration of your GCP queue
    • Set config.processor_host to the ngrok http or https url
    • Set config.mode to :production
  5. Launch the server: foreman start web
  6. Open a Sinatra console: ./bin/console
  7. Setup your queues on Google Cloud Tasks:
# Default and critical queues
Cloudtasker::CloudTask.setup_production_queue
Cloudtasker::CloudTask.setup_production_queue(name: 'critical')
  1. Enqueue workers:
DummyWorker.perform_async