Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2014-11-14 22:44:46 +0300
committermichael-grunder <michael.grunder@gmail.com>2014-11-14 22:44:46 +0300
commit6f75b0ea740042ea7eae0e04cfc45de1944b3cac (patch)
tree1220448d1e8e901fb1bd646902ebc25f7f645e38 /README.markdown
parente8ad58b97b3f79e69d7d4effcf691df53ce24f9b (diff)
Allow for subscribe callback to return any value
This commit changes the behaviour of the various subscribe flavors such that the callback can break the loop by returning any non-null value. This would allow, for example, context to be retreived from the message and then used in such a way to return it to the caller.
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown4
1 files changed, 2 insertions, 2 deletions
diff --git a/README.markdown b/README.markdown
index cb32804b..69783919 100644
--- a/README.markdown
+++ b/README.markdown
@@ -2898,7 +2898,7 @@ _**Description**_: Subscribe to channels by pattern
##### *Parameters*
*patterns*: An array of patterns to match
*callback*: Either a string or an array with an object and method. The callback will get four arguments ($redis, $pattern, $channel, $message)
-
+*return value*: Mixed. Any non-null return value in the callback will be returned to the caller.
##### *Example*
~~~
function psubscribe($redis, $pattern, $chan, $msg) {
@@ -2928,7 +2928,7 @@ _**Description**_: Subscribe to channels. Warning: this function will probably c
##### *Parameters*
*channels*: an array of channels to subscribe to
*callback*: either a string or an array($instance, 'method_name'). The callback function receives 3 parameters: the redis instance, the channel name, and the message.
-
+*return value*: Mixed. Any non-null return value in the callback will be returned to the caller.
##### *Example*
~~~
function f($redis, $chan, $msg) {