3

I'm running Laravel 6 on Google App Engine Standard and trying to make Laravel Queues work with Google Tasks natively.

Currently I'm creating (dispatching) and handling tasks with custom classes, but I would like to use Google task as native Laravel Queues, so I can call Job::dispatch() dispatch(new Job) and use Mail, Notification with Queueable. But unfortunately it is beyond my abilities and I can’t figure out how everything is interconnected in Laravel.

ProgZi
  • 1,028
  • 3
  • 14
  • 25

1 Answers1

1

Using Google Cloud API, you can create multiple queues for different target applications, deployed on Google App Engine in either Standard or Flexible environment.(Check here)

Here you can find detailed instructions on how to associate your Laravel project with Google Cloud Tasks processing asynchronous Jobs.

-Basically, you will create a task queue with a “queue.yaml” file, to handle the Cloud Tasks.

-Before Creating the Task:

---Pass the route of the API and the payload object for the Task.

---Authenticate userID in payload.

-Build/Create the Task. Using the method demonstrated on the example, it will use the Google API to build a Cloud Task and pass it to the task queue.

-Create the API routes in api.php.

-Create a TaskController which will route the different API to the specific (associateApp()) function.

  • 1
    This is a good answer, but only for regular Google Task integration. What I need is to be able to use it natively with Queueable, ::dispatch(), dispatch – ProgZi Oct 29 '19 at 13:46
  • I apologize for misunderstanding your question. After extended research on Google Cloud Platform official documentation, I figured out that in order to implement Cloud Tasks in gcloud you would need to follow the aforementioned instructions. Cloud tasks are not designed to be integrated with other queues, but if there is a way to implement it natively in Laravel side, I can not help any further, since it doesn't seem to be documented anywhere. – Artemis Georgakopoulou Oct 30 '19 at 13:53