You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 85fd80c
Browse filesBrowse the repository at this point in the historyBrowse files
Refactor: Bundle pybmq::Session options into SessionConfig
The constructor to `pybmq::Session` has been getting a little
unwieldy, growing to 21 parameters. Originally, passing parameters
directly to `pybmq::Session` like this resulted in the simplest and
most transparent code in the Cython layer (which is the layer that is
hardest to debug) and meant we didn’t need to worry too much about the
reference counting of Python objects being marshalled through Cython.
But, with so many parameters now, this is more of a liability than a
benefit.
This patch adds a new struct `pybmq::SessionConfig`, which holds the
fourteen plain option values. The Python callbacks, host health
monitor and exception types stay as constructor parameters, so no
Python object lives in the struct for reference counting ease. Adding
this struct allows us to simplify the constructor for `pybmq::Session`
down from taking 21 arguments to taking only 8.
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
0 commit comments