Skip to content

Commit

Permalink
Add a comment of zmq.LINGER
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Dec 16, 2024
1 parent ec253ea commit 518de38
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/_ert/forward_model_runner/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def __init__(
self._ack_event: asyncio.Event = asyncio.Event()
self.context = zmq.asyncio.Context()
self.socket = self.context.socket(zmq.DEALER)
# this is to avoid blocking the event loop when closing the socket
# wherein the linger is set to 0 to discard all messages in the queue
self.socket.setsockopt(zmq.LINGER, 0)
self.dealer_id = dealer_name or f"dispatch-{uuid.uuid4().hex[:8]}"
self.socket.setsockopt_string(zmq.IDENTITY, self.dealer_id)
Expand Down

0 comments on commit 518de38

Please sign in to comment.