Skip to content

Commit

Permalink
Improved push promise data.
Browse files Browse the repository at this point in the history
  • Loading branch information
andot committed Oct 16, 2016
1 parent e7a72e1 commit 30f1151
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Hprose/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* *
* hprose service class for php 5.3+ *
* *
* LastModified: Sep 23, 2016 *
* LastModified: Oct 16, 2016 *
* Author: Ma Bingyao <andot@hprose.com> *
* *
\**********************************************************/
Expand Down Expand Up @@ -1089,7 +1089,18 @@ public function publish($topic, array $options = array()) {
return $self->setRequestTimer($topic, $id, $request, $timeout);
}, $topic);
}
private function internalPush($topic, $id, $result) {
/*
This method is a private method.
But PHP 5.3 can't call private method in closure,
so we comment the private keyword.
*/
/*private*/ function internalPush($topic, $id, $result) {
if (Future\isFuture($result)) {
$self = $this;
return $result->complete(function($value) use ($self, $topic, $id) {
return $self->internalPush($topic, $id, $value);
});
}
$topics = $this->getTopics($topic);
if (!isset($topics[$id])) {
return Future\value(false);
Expand Down

0 comments on commit 30f1151

Please sign in to comment.