Skip to content

Latest commit

 

History

History
56 lines (34 loc) · 1.29 KB

example.md

File metadata and controls

56 lines (34 loc) · 1.29 KB

PHP Simple Queue Example

Examples and work demonstrating.

📖 Guide


📄 Example

Example of sending messages to a queue: produce.php

Example of processing messages from a queue: consume.php

Advanced example of processing messages from a queue: advanced-consume.php


Quick run with docker

cd .docker - go to dir.

Run the following commands:

  • make build - build docker container
  • make start - start docker container
  • make php cmd='./example/consume.php' - run consume (to read messages from the queue)
  • make php cmd='./example/produce.php' - run produce (to sent messages to the queue)

Both examples should work in different tabs because they are daemons (while(true){}).


PHP command access:

  • make php cmd='{you_command}':
  • Example: make php cmd='-v':

Composer command access:

  • make composer cmd='{you_command}':
  • Example: - make composer cmd='update':