Created
April 5, 2013 11:11
-
-
Save romainneutron/5318519 to your computer and use it in GitHub Desktop.
React/stomp heartbeat implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace React\Stomp; | |
class HeartBeatClient implements ClientInterface | |
{ | |
private $client; | |
public function __construct(ClientInterface $client, $clientGuarantee, $serverGuarantee) | |
{ | |
$this->client = $client; | |
// implement heartbeat stuff here | |
} | |
public function connect($timeout = 5) | |
{ | |
return $this->client->connect($timeout); | |
} | |
public function send($destination, $body, array $headers = array()) | |
{ | |
return $this->client->send($destination, $body, $headers); | |
} | |
public function subscribe($destination, $callback, array $headers = array()) | |
{ | |
return $this->client->subscribe($destination, $callback, $headers); | |
} | |
public function subscribeWithAck($destination, $ack, $callback, array $headers = array()) | |
{ | |
$this->client->subscribeWithAck($destination, $ack, $callback, $headers); | |
} | |
public function unsubscribe($subscriptionId, array $headers = array()) | |
{ | |
return $this->client->unsubscribe($subscriptionId, $headers); | |
} | |
public function ack($subscriptionId, $messageId, array $headers = array()) | |
{ | |
return $this->client->ack($subscriptionId, $messageId, $headers); | |
} | |
public function nack($subscriptionId, $messageId, array $headers = array()) | |
{ | |
return $this->client->nack($subscriptionId, $messageId, $headers); | |
} | |
public function disconnect() | |
{ | |
return $this->client->disconnect(); | |
} | |
public function isConnected() | |
{ | |
return $this->client->isConnected(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment