Skip to content

Commit

Permalink
Merge pull request php-enqueue#597 from php-enqueue/fix-wamp
Browse files Browse the repository at this point in the history
fix wamp
  • Loading branch information
makasim authored Oct 30, 2018
2 parents 0cb41ff + 9d45b78 commit dfc6768
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions pkg/wamp/WampConnectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class WampConnectionFactory implements ConnectionFactory
* The config could be an array, string DSN or null. In case of null it will attempt to connect to Ratchet localhost.
*
* $config = [
* 'lazy' => true,
* 'dsn' => 'wamp://127.0.0.1:9090',
* 'host' => '127.0.0.1',
* 'port' => '9090',
Expand Down Expand Up @@ -50,7 +49,6 @@ public function __construct($config = 'wamp:')
}

$config = array_replace([
'lazy' => true,
'host' => '127.0.0.1',
'port' => '9090',
'max_retries' => 15,
Expand All @@ -64,13 +62,9 @@ public function __construct($config = 'wamp:')

public function createContext(): Context
{
if ($this->config['lazy']) {
return new WampContext(function () {
return $this->establishConnection();
});
}

return new WampContext($this->establishConnection());
return new WampContext(function () {
return $this->establishConnection();
});
}

private function establishConnection(): Client
Expand Down

0 comments on commit dfc6768

Please sign in to comment.