Skip to content

Commit 5d277b4

Browse files
authored
Merge pull request #252 from vasilevrv/master
Add linger param to zmq pusher
2 parents 3064029 + d560377 commit 5d277b4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

DependencyInjection/Configuration.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ protected function addZmqNode()
193193
->defaultValue('tcp')
194194
->values(['tcp', 'ipc', 'inproc', 'pgm', 'epgm'])
195195
->end()
196+
->integerNode('linger')
197+
->defaultValue(-1)
198+
->end()
196199
->end();
197200

198201
return $node;

Pusher/Zmq/ZmqPusher.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ protected function doPush($data, array $context)
2525

2626
$context = new \ZMQContext(1, $config['persistent']);
2727
$this->connection = new \ZMQSocket($context, \ZMQ::SOCKET_PUSH);
28+
$this->connection->setSockOpt(\ZMQ::SOCKOPT_LINGER, $config['linger']);
2829
$this->connection->connect($config['protocol'] . '://' . $config['host'] . ':' . $config['port']);
2930
$this->setConnected();
3031
}

0 commit comments

Comments
 (0)