Submit Your Project / Idea
We are actively looking for cool ideas of packages / projects to develop. Have an idea, or need a specific package developed that you're having trouble finding elsewhere? Drop a message on the Reddit forum and let us know!
Your idea may get developed free of charge and open sourced, or maybe will be developed and released commercially for a small license fee, or maybe will spawn a great discussion and even better ideas! If your idea is picked up, it will be listed on the Projects page.
Jump in and share your ideas! Don't be left behind, get modern and professional with Apex!
Event listeners, also currently known as the worker Component are PHP classes that receive and process incoming messages dispatched from the front-end servers. These listeners will reside on the back-end application servers, and handle the resource intensive operations of the system.
Again, routing keys are a string comprised of three elements, separated by a comma. The first element is the package alias, the second any alias you wish for the listener, and the third is the method name within the PHP listener class. You can create a new listener by creating a new worker Component, and for example within terminal type:
``./apex create worker casino.games casino.games`
This will create a blank PHP class at /src/casino/worker/games.php which you can fill with any methods you
desire. For example, maybe you add a
Now that we have our listener in place, we can start dispatching messages to it from the views / front-end servers. For example:
Example -- Execute PHP upon user Registration
Again, you will need to consult the documentation of the packages you are developing with to know which routing keys they support. For another example, say we want to execute PHP code every time a new user is registered, which we can do via the "users.profile.created" routing key. First, create a new worker / listener, and in terminal type:
`./apex create worker casino:users users.profile~
This will create a blank PHP listener class at /src/casino/worker/users.php, and will begin receiving all
messages dispatched to the "users.profile.*" routing key. Within the PHP class, add a
That's it. Now every time a new user is registered, that above method will be executed.