2017 © Pedro Peláez
 

library backq

Background asynchronous job processing with queue, workers & publishers

image

sshilko/backq

Background asynchronous job processing with queue, workers & publishers

  • Friday, January 5, 2018
  • by sshilko
  • Repository
  • 2 Watchers
  • 12 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 20 Versions
  • 0 % Grown

The README.md

BackQ - Component

Background queue processing - publish tasks and process with workers, simplified., (*1)

  • Sending APNS push notifications (Legacy API)
  • Sending FCM push notifications to Android (GCM/FCM)
  • Sending AWS SNS push notifications via AWS SNS arn's
  • Executing Psr7\Request asynchronously via Guzzle
  • Executing any processes with symfony/process
  • Long delay scheduling via DynamoSQS Adapter and Serialized worker, for reliable long-term scheduled jobs
  • Extendable - write your own worker and use existing adapters out of the box ...

Installation

#composer self-update && composer clear-cache && composer diagnose
composer require sshilko/backq:^3.0

Example with Redis adapter and process worker

#launch local redis
docker run -d --name=example-backq-redis --network=host redis

#install library in any folder for testing
mkdir /tmp/example && cd /tmp/example
composer require sshilko/backq:^3.0

#post job to queue (schedule)
cd vendor/sshilko/backq/example/publishers/process && php redis.php && cd /tmp/example

#[debug] connect
#[debug] _connect
#[debug] putTask
#[debug] putTask is connected and ready to: write
#[debug] putTask pushed task without delay xoOgPKcS9bIDVXSaLYH9aLB22gzzptRo
#[debug] putTask return 'xoOgPKcS9bIDVXSaLYH9aLB22gzzptRo'
#Published process message via redis adapter as ID=xoOgPKcS9bIDVXSaLYH9aLB22gzzptRo

#fetch job from queue (work)
cd vendor/sshilko/backq/example/workers/process && php redis.php && cd /tmp/example

#[debug] connect
#[debug] _connect
#[debug] pickTask
#[debug] pickTask blocking for 5 seconds until get a job
#[debug] pickTask reserved a job nOgykJV81g969yw2wRMF94V9KiIeKN4P
#[debug] afterWorkSuccess
#[debug] afterWorkSuccess currently 1 reserved job(s)
#[debug] afterWorkSuccess releasing completed nOgykJV81g969yw2wRMF94V9KiIeKN4P job
#[debug] Disconnecting
#[debug] Disconnecting, previously connected
#[debug] Disconnecting, state detected
#[debug] Disconnecting, state detected, queue is connected
#[debug] Disconnecting, state 0 jobs reserved and not finalized
#[debug] Disconnecting, state detected, disconnecting queue manager
#[debug] Disconnecting, successful

#verify job executed (example process worker does echo $( date +%s ) >> /tmp/test) 
cat /tmp/test

docker stop example-backq-redis

Supported queue servers

Features

Workers compatibility with adapters, (*2)

Adapter / Worker FCM APNS Process Guzzle Serialized AWS SNS Closure
Beanstalkd + + + + + + +
Redis + + + + ? + +
NSQ + + + + ? + ?
DynamoSQS + + + + + ? +

Adapter implemented features, (*3)

Adapter / Feature ping hasWorkers setWorkTimeout
Beanstalkd + + +
Redis + - +
NSQ + - *
DynamoSQS - - +

Worker available features, (*4)

  • setRestartThreshold (limit max number of jobs cycles, then terminate)
  • setIdleTimeout (limit max idle time, then terminating)

TLDR, (*5)

Backq, (*6)

See /example folder for usage examples, (*7)

Old version 1 detailed review

Blog post about sending Apple push notifications, (*8)

Licence

MIT, (*9)

Copyright 2013-2022 Sergei Shilko Copyright 2016-2019 Carolina Alarcon, (*10)

The Versions

05/01 2018

dev-master

9999999-dev https://github.com/sshilko/backq

Background asynchronous job processing with queue, workers & publishers

  Sources   Download

MIT

The Requires

 

psr7 aws queue sns guzzle async worker process background notification apple ios push apns fcm send

05/01 2018

1.3.1

1.3.1.0 https://github.com/sshilko/backq

Background asynchronous job processing with queue, workers & publishers

  Sources   Download

The Requires

 

psr7 aws queue sns guzzle async worker process background notification apple ios push apns fcm send

12/12 2017

1.3.0

1.3.0.0 https://github.com/sshilko/backq

Background asynchronous job processing with queue, workers & publishers

  Sources   Download

The Requires

 

psr7 aws queue sns guzzle async worker process background notification apple ios push apns fcm send

06/09 2017

1.2.1

1.2.1.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue async worker process background notification apple ios push apns send

11/01 2017

1.2.0

1.2.0.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue async worker process background notification apple ios push apns send

28/03 2016

1.1.2

1.1.2.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue async worker process background notification apple ios push apns send

28/03 2016

1.1.1

1.1.1.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue async worker process background notification apple ios push apns send

28/03 2016

1.1.0

1.1.0.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue async worker process background notification apple ios push apns send

10/02 2016

1.0.11

1.0.11.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue worker background notification apple ios push apns send

12/12 2015

1.0.10

1.0.10.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue worker background notification apple ios push apns send

11/12 2015

1.0.9

1.0.9.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue worker background notification apple ios push apns send

11/12 2015

1.0.8

1.0.8.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue worker background notification apple ios push apns send

23/04 2015

1.0.7

1.0.7.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue worker background notification apple ios push apns send

16/04 2015

1.0.6

1.0.6.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue worker background notification apple ios push apns send

07/04 2015

1.0.5

1.0.5.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue worker apple ios push apns

30/01 2015

1.0.4

1.0.4.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue worker apple ios push apns

04/11 2014

1.0.3

1.0.3.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue worker apple ios push apns

07/10 2014

1.0.2

1.0.2.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue worker apple ios push apns

07/10 2014

1.0.1

1.0.1.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue worker apple ios push apns

25/09 2014

1.0.0

1.0.0.0 https://github.com/sshilko/backq

Background push notifications processing with workers & publisher

  Sources   Download

MIT

The Requires

 

queue worker apple ios push apns