You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
6
+
7
+
Examples of unacceptable behavior by participants include:
8
+
9
+
* The use of sexualized language or imagery
10
+
* Personal attacks
11
+
* Trolling or insulting/derogatory comments
12
+
* Public or private harassment
13
+
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
14
+
* Other unethical or unprofessional conduct.
15
+
16
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
17
+
18
+
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community in a direct capacity. Personal views, beliefs and values of individuals do not necessarily reflect those of the organisation or affiliated individuals and organisations.
19
+
20
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
21
+
22
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
Contributions are **welcome** and will be fully **credited**.
4
+
5
+
We accept contributions via Pull Requests on [Github](https://github.com/php-amqplib/thumper).
6
+
7
+
8
+
## Pull Requests
9
+
10
+
-**[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
11
+
12
+
-**Add tests!** - Your patch won't be accepted if it doesn't have tests.
13
+
14
+
-**Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
15
+
16
+
-**Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
17
+
18
+
-**Create feature branches** - Don't ask us to pull from your master branch.
19
+
20
+
-**One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
21
+
22
+
-**Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
Thumper is a PHP library that aims to abstract several messaging patterns that can be implemented over RabbitMQ.
8
11
9
12
Inside the _examples_ folder you can see how to implement RPC, parallel processing, simple queue servers and pub/sub.
10
13
11
-
INSTALLATION
12
-
13
-
@seehttp://getcomposer.org for composer details.
14
+
## Install
14
15
15
-
Clone this project and then just run `composer update` to fetch the dependencies.
16
+
Via Composer
16
17
17
-
This project requires the php-amqplib library.
18
+
```bash
19
+
$ composer require php-amqplib/thumper
20
+
```
18
21
19
-
# About the Examples #
22
+
##About the Examples
20
23
21
24
Each example has a README.md file that shows how to execute it. All the examples expect that RabbitMQ is running. They have been tested using RabbitMQ 2.1.1
22
25
@@ -39,30 +42,64 @@ And then to consume them on the other side of the wire:
39
42
$consumer->setCallback($myConsumer); //myConsumer could be any valid PHP callback
40
43
$consumer->consume(5); //5 is the number of messages to consume.
41
44
42
-
## Queue Server ##
45
+
###Queue Server
43
46
44
47
This example illustrates how to create a producer that will publish jobs into a queue. Those jobs will be processed later by a consumer –or several of them–.
45
48
46
-
## RPC ##
49
+
###RPC
47
50
48
51
This example illustrates how to do RPC over RabbitMQ. We have a RPC Client that will send request to a server that returns the number of characters in the provided strings. The server code is inside the _parallel\_processing_ folder.
49
52
50
-
## Parallel Processing ##
53
+
###Parallel Processing
51
54
52
55
This example is based on the RPC one. In this case it shows how to achieve parallel execution with PHP. Let's say that you have to execute two expensive tasks. One takes 5 seconds and the other 10. Instead of waiting 15 seconds, we can send the requests in parallel and then wait for the replies which should take 10 seconds now –the time of the slowest task–.
53
56
54
-
## Topic ##
57
+
###Topic
55
58
56
59
In this case we can see how to achieve publish/subscribe with RabbitMQ. The example is about logging. We can log with several levels and subjects and then have consumers that listen to different log levels act accordingly.
57
60
58
-
## Anonymous Consumers ##
61
+
###Anonymous Consumers
59
62
60
63
Also inside the _topic_ folder there's an anonymous consumer example. The idea here is for those situations when you need to hook up a queue to some exchange to "spy" what's going on, but when you quit your program you want that the queue is automatically deleted. We can achieve this using an unnamed queue.
61
64
62
-
# Disclaimer #
65
+
## Change log
66
+
67
+
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
68
+
69
+
## Testing
70
+
71
+
```bash
72
+
$ composer test
73
+
```
74
+
75
+
## Contributing
76
+
77
+
Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.
78
+
79
+
## Disclaimer
63
80
64
81
This code is experimental. The idea is to show how easy is to implement such patterns with RabbitMQ and AMQP.
65
82
66
-
# License #
83
+
## Credits
84
+
85
+
-[:author_name][link-author]
86
+
-[All Contributors][link-contributors]
87
+
88
+
## License
89
+
90
+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
0 commit comments