diff --git a/docs/_config.yml b/docs/_config.yml
index 1b80a1f392..d5745d1d80 100644
--- a/docs/_config.yml
+++ b/docs/_config.yml
@@ -47,11 +47,20 @@ exclude:
# theme test code
- fixtures/
+# Jekyll ignores files whose name begins with an underscore by default, yet the
+# Python SDK API documentation generated by Sphinx creates many of these. We
+# have to explicitly include each such file here or it will not be copied into
+# the GitHub Pages.
include:
- _static
- _modules
- _sources
- - _sphinx_javascript_frameworks_compat.js # Required for the Python SDK API documentation
+ - _sphinx_javascript_frameworks_compat.js
+ - _enums.html
+ - _messages.html
+ - _monitors.html
+ - _session.html
+ - _timeouts.html
# Set a path/url to a logo that will be displayed instead of the title
logo: "/assets/images/Asset 2@3x.png"
diff --git a/docs/docs/apidocs/python_apidocs/BUILD.html b/docs/docs/apidocs/python_apidocs/BUILD.html
index fcd68a9475..b7e5d1cbdc 100644
--- a/docs/docs/apidocs/python_apidocs/BUILD.html
+++ b/docs/docs/apidocs/python_apidocs/BUILD.html
@@ -1,12 +1,14 @@
-
+
When in an interactive command line prompt, you can use the following
-make targets to build and test the BlazingMQ Python SDK. Check the
-GitHub Actions configuration to set up the appropriate environment
-variables that may be needed prior to running these commands (such as
-setting PYEXEC). With a BlazingMQ broker running at
-‘tcp://localhost:30114‘, the following targets build and test the
-Python SDK:
+
When in an interactive command line prompt, you can use the following make
+targets to build and test the BlazingMQ Python SDK. Check the
+appropriate GitHub Actions configuration to set up the appropriate environment
+variables that may be needed prior to running these commands (such as setting
+PYEXEC). With a BlazingMQ broker running at tcp://localhost:30114, the
+following targets build and test the Python SDK:
KNOWN_MONITORS=("blazingmq.BasicHealthMonitor",)
-def_convert_timeout(timeout:float)->Optional[float]:
+def_validate_timeouts(timeouts:Timeouts)->Timeouts:
+"""Validate a `.Timeouts` instance for use by the Cython layer.
+
+ If any of the timeouts contained within the `.Timeouts` instance are the
+ `DEFAULT_TIMEOUT` sentinel or `None`, return `None`. Otherwise, validate
+ that it is within the range accepted by `bsls::TimeInterval` and return it.
+ """
+ returnTimeouts(
+ connect_timeout=_convert_timeout(timeouts.connect_timeout),
+ disconnect_timeout=_convert_timeout(timeouts.disconnect_timeout),
+ open_queue_timeout=_convert_timeout(timeouts.open_queue_timeout),
+ configure_queue_timeout=_convert_timeout(timeouts.configure_queue_timeout),
+ close_queue_timeout=_convert_timeout(timeouts.close_queue_timeout),
+ )
+
+
+def_convert_timeout(timeout:Optional[float])->Optional[float]:"""Convert the timeout for use by the Cython layer.
- If it is the DEFAULT_TIMEOUT sentinel, return None. Otherwise, validate
- that it is within the range accepted by bsls::TimeInterval and return it.
+ If it is the DEFAULT_TIMEOUT sentinel or None, return None. Otherwise,
+ validate that it is within the range accepted by bsls::TimeInterval and
+ return it. """
- iftimeoutisDEFAULT_TIMEOUT:
+ iftimeoutisDEFAULT_TIMEOUTortimeoutisNone:returnNone
- eliftimeoutisnotNoneand(0.0<float(timeout)<2**63):
- returnfloat(timeout)
+ elif0.0<timeout<2**63:
+ returntimeoutraiseValueError(f"timeout must be greater than 0.0, was {timeout}")
+def_convert_stats_dump_interval(interval:Optional[float])->Optional[float]:
+"""Convert the stats dump interval for use by the Cython layer.
+
+ If is None, return None. Otherwise, validate that it is within the range
+ accepted by bsls::TimeInterval and return it.
+ """
+ ifintervalisNone:
+ returninterval
+ if0.0<=interval<2**63:
+ returninterval
+ raiseValueError(f"stats_dump_interval must be nonnegative, was {interval}")
+
+
def_collect_properties_and_types(properties:Optional[PropertyValueDict],property_type_overrides:Optional[PropertyTypeDict],
@@ -286,7 +319,119 @@
+[docs]
+classSessionOptions:
+"""A value semantic type representing session options.
+
+ Each option can be set either by passing it as a keyword argument when
+ constructing a *SessionOptions* instance, or by setting it as an attribute
+ on a constructed instance.
+
+ The default for every option is `None`. When constructing a `Session`,
+ options set to `None` are given reasonable default values.
+
+ Args:
+ message_compression_algorithm:
+ The type of compression to apply to messages being posted via the
+ session this object is configuring.
+ timeouts:
+ The maximum number of seconds to wait for requests for each
+ operation on this session. If not provided, reasonable defaults
+ are used.
+ host_health_monitor:
+ A `.BasicHealthMonitor` is used by default, so your tests can
+ control whether the session sees the machine as healthy or not by
+ calling `.set_healthy` and `.set_unhealthy` on that instance. If
+ you instead pass `None`, the session will always see the machine as
+ healthy, `.HostUnhealthy` and `.HostHealthRestored` events with
+ never be emitted, and the *suspends_on_bad_host_health* option of
+ `QueueOptions` cannot be used.
+ num_processing_threads:
+ The number of threads for the SDK to use for processing events.
+ This defaults to 1.
+ blob_buffer_size:
+ The size (in bytes) of the blob buffers to use. This defaults to
+ 4k.
+ channel_high_watermark:
+ The size (in bytes) to use for the write cache high watermark on
+ the channel. The default value is 128MB. Note that BlazingMQ
+ reserves 4MB of this value for control messages, so the actual
+ watermark for data published is ``channel_high_watermark - 4MB``.
+ event_queue_watermarks:
+ A tuple containing the low and high notification watermark
+ thresholds for the buffer containing all incoming messages from the
+ broker, respectively. A warning `.SlowConsumerHighWaterMark` is
+ emitted when the buffer reaches the high watermark value, and a
+ notification `.SlowConsumerNormal` is emitted when the buffer is
+ back to the low watermark.
+ stats_dump_interval:
+ The interval (in seconds) at which to dump stats into the logs. If
+ 0, disable the recurring dump of stats (final stats are always
+ dumped at the end of the session). The default is 5min; the value
+ must be a multiple of 30s, in the range ``[0s - 60min]``.
+ """
+
+ def__init__(
+ self,
+ message_compression_algorithm:Optional[CompressionAlgorithmType]=None,
+ timeouts:Optional[Timeouts]=None,
+ host_health_monitor:Union[BasicHealthMonitor,None]=(DefaultMonitor()),
+ num_processing_threads:Optional[int]=None,
+ blob_buffer_size:Optional[int]=None,
+ channel_high_watermark:Optional[int]=None,
+ event_queue_watermarks:Optional[tuple[int,int]]=None,
+ stats_dump_interval:Optional[float]=None,
+ )->None:
+ self.message_compression_algorithm=message_compression_algorithm
+ self.timeouts=timeouts
+ self.host_health_monitor=host_health_monitor
+ self.num_processing_threads=num_processing_threads
+ self.blob_buffer_size=blob_buffer_size
+ self.channel_high_watermark=channel_high_watermark
+ self.event_queue_watermarks=event_queue_watermarks
+ self.stats_dump_interval=stats_dump_interval
+
+ def__eq__(self,other:object)->bool:
+ ifnotisinstance(other,SessionOptions):
+ returnFalse
+ return(
+ self.message_compression_algorithm==other.message_compression_algorithm
+ andself.timeouts==other.timeouts
+ andself.host_health_monitor==other.host_health_monitor
+ andself.num_processing_threads==other.num_processing_threads
+ andself.blob_buffer_size==other.blob_buffer_size
+ andself.channel_high_watermark==other.channel_high_watermark
+ andself.event_queue_watermarks==other.event_queue_watermarks
+ andself.stats_dump_interval==other.stats_dump_interval
+ )
+
+ def__ne__(self,other:object)->bool:
+ returnnotself==other
+
+ def__repr__(self)->str:
+ attrs=(
+ "message_compression_algorithm",
+ "timeouts",
+ "host_health_monitor",
+ "num_processing_threads",
+ "blob_buffer_size",
+ "channel_high_watermark",
+ "event_queue_watermarks",
+ "stats_dump_interval",
+ )
+
+ params=[]
+ forattrinattrs:
+ value=getattr(self,attr)
+ ifvalueisnotNone:
+ params.append(f"{attr}={value!r}")
+
+ returnf"SessionOptions({', '.join(params)})"
@@ -305,11 +450,16 @@
Source code for blazingmq._session
received by the session. on_message: an optional callback to process `Message` objects received by the session.
- broker: TCP address of the broker (default: 'tcp://localhost:30114')
+ broker: TCP address of the broker (default: 'tcp://localhost:30114').
+ If the environment variable ``BMQ_BROKER_URI`` is set, its value
+ will override whatever broker address is passed via this argument. message_compression_algorithm: the type of compression to apply to messages being posted via this session object. timeout: maximum number of seconds to wait for requests on this
- session. If not provided, reasonable defaults are used.
+ session. If not provided, reasonable defaults are used. This
+ argument may either be a simple ``float``, which sets the same
+ timeout for each operation, or an instance of the `Timeouts` class,
+ which allows setting the timeout for each operation independently. host_health_monitor: A `.BasicHealthMonitor` is used by default, so your tests can control whether the session sees the machine as healthy or not by calling `.set_healthy` and `.set_unhealthy` on
@@ -318,12 +468,33 @@
Source code for blazingmq._session
`.HostHealthRestored` events will never be emitted, and the *suspends_on_bad_host_health* option of `QueueOptions` cannot be used.
+ num_processing_threads: The number of threads for the SDK to use for
+ processing events. This defaults to 1.
+ blob_buffer_size: The size (in bytes) of the blob buffers to use. This
+ defaults to 4k.
+ channel_high_watermark: The size (in bytes) to use for the write cache
+ high watermark on the channel. The default value is 128MB. Note
+ that BlazingMQ reserves 4MB of this value for control messages, so
+ the actual watermark for data published is
+ ``channel_high_watermark - 4MB``.
+ event_queue_watermarks: A tuple containing the low and high
+ notification watermark thresholds for the buffer containing all
+ incoming messages from the broker, respectively. A warning
+ `.SlowConsumerHighWaterMark` is emitted when the buffer reaches the
+ high watermark value, and a notification `.SlowConsumerNormal` is
+ emitted when the buffer is back to the low watermark.
+ stats_dump_interval: The interval (in seconds) at which to dump stats
+ into the logs. If 0, disable the recurring dump of stats (final
+ stats are always dumped at the end of the session). The default is
+ 5min; the value must be a multiple of 30s, in the range
+ ``[0s - 60min]``. Raises: `~blazingmq.Error`: If the session start request was not successful. `~blazingmq.exceptions.BrokerTimeoutError`: If the broker didn't respond to the request within a reasonable amount of time.
- `ValueError`: If *timeout* is provided and not > 0.0.
+ `ValueError`: If any of the timeouts are provided and not > 0.0, or if
+ the ``stats_dump_interval`` is provided and is < 0.0. """def__init__(
@@ -334,8 +505,13 @@
fake_host_health_monitor=getattr(host_health_monitor,"_monitor",None)self._has_no_on_message=on_messageisNone
+
+ # Using our Timeouts class, preserve the old behavior of passing in a
+ # simple float as a timeout. Avoid setting the `connect_timeout` and
+ # `disconnect_timeout`.
+ ifnotisinstance(timeout,Timeouts):
+ timeout=Timeouts(
+ open_queue_timeout=timeout,
+ configure_queue_timeout=timeout,
+ close_queue_timeout=timeout,
+ )
+
self._ext=ExtSession(on_session_event,on_message=on_message,broker=six.ensure_binary(broker),message_compression_algorithm=message_compression_algorithm,
- timeout=_convert_timeout(timeout),
+ num_processing_threads=num_processing_threads,
+ blob_buffer_size=blob_buffer_size,
+ channel_high_watermark=channel_high_watermark,
+ event_queue_watermarks=event_queue_watermarks,
+ stats_dump_interval=_convert_stats_dump_interval(stats_dump_interval),
+ timeouts=_validate_timeouts(timeout),monitor_host_health=monitor_host_health,fake_host_health_monitor=fake_host_health_monitor,)
+
+[docs]
+ @classmethod
+ defwith_options(
+ cls,
+ on_session_event:Callable[[SessionEvent],None],
+ on_message:Optional[Callable[[Message,MessageHandle],None]]=None,
+ broker:str="tcp://localhost:30114",
+ session_options:SessionOptions=(SessionOptions()),
+ )->Session:
+"""Construct a *Session* instance using `.SessionOptions`.
+
+ This is the recommended way to construct a new session, as the
+ `.SessionOptions` class provides an easier to use interface for
+ configuring only those options you need.
+
+ Args:
+ on_session_event: a required callback to process `.SessionEvent` events
+ received by the session.
+ on_message: an optional callback to process `Message` objects received
+ by the session.
+ broker: TCP address of the broker (default: 'tcp://localhost:30114').
+ If the environment variable ``BMQ_BROKER_URI`` is set, its value
+ will override whatever broker address is passed via this argument.
+ session_options: an instance of `.SessionOptions` that represents the
+ session's configuration.
+
+ Raises:
+ `~blazingmq.Error`: If the session start request was not successful.
+ `~blazingmq.exceptions.BrokerTimeoutError`: If the broker didn't respond
+ to the request within a reasonable amount of time.
+ `ValueError`: If any of the timeouts are provided and not > 0.0, or if
+ the ``stats_dump_interval`` is provided and is < 0.0.
+ """
+ message_compression_algorithm=session_options.message_compression_algorithm
+ ifmessage_compression_algorithmisNone:
+ message_compression_algorithm=CompressionAlgorithmType.NONE
+
+ ifsession_options.timeoutsisNone:
+ returncls(
+ on_session_event,
+ on_message,
+ broker,
+ message_compression_algorithm,
+ DEFAULT_TIMEOUT,
+ session_options.host_health_monitor,
+ session_options.num_processing_threads,
+ session_options.blob_buffer_size,
+ session_options.channel_high_watermark,
+ session_options.event_queue_watermarks,
+ session_options.stats_dump_interval,
+ )
+ else:
+ returncls(
+ on_session_event,
+ on_message,
+ broker,
+ message_compression_algorithm,
+ session_options.timeouts,
+ session_options.host_health_monitor,
+ session_options.num_processing_threads,
+ session_options.blob_buffer_size,
+ session_options.channel_high_watermark,
+ session_options.event_queue_watermarks,
+ session_options.stats_dump_interval,
+ )
+# Copyright 2019-2023 Bloomberg Finance L.P.
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from__future__importannotations
+
+fromtypingimportOptional
+
+
+
+[docs]
+classTimeouts:
+"""A value semantic type representing session timeouts.
+
+ Each option can be set either by passing it as a keyword argument when
+ constructing a *Timeouts* instance, or by setting it as an attribute on
+ a constructed instance.
+
+ The default for every option is `None`. When constructing a `Session`,
+ either directly or using `SessionOptions`, options set to `None` are given
+ reasonable default values.
+
+ Args:
+ connect_timeout:
+ The maximum number of seconds to wait for connection requests on
+ this session.
+ disconnect_timeout:
+ The maximum number of seconds to wait for disconnection requests
+ on this session.
+ open_queue_timeout:
+ The maximum number of seconds to wait for open queue requests on
+ this session.
+ configure_queue_timeout:
+ The maximum number of seconds to wait for configure queue requests
+ on this session.
+ close_queue_timeout:
+ The maximum number of seconds to wait for close queue requests on
+ this session.
+ """
+
+ def__init__(
+ self,
+ connect_timeout:Optional[float]=None,
+ disconnect_timeout:Optional[float]=None,
+ open_queue_timeout:Optional[float]=None,
+ configure_queue_timeout:Optional[float]=None,
+ close_queue_timeout:Optional[float]=None,
+ )->None:
+ self.connect_timeout=connect_timeout
+ self.disconnect_timeout=disconnect_timeout
+ self.open_queue_timeout=open_queue_timeout
+ self.configure_queue_timeout=configure_queue_timeout
+ self.close_queue_timeout=close_queue_timeout
+
+ def__eq__(self,other:object)->bool:
+ ifnotisinstance(other,Timeouts):
+ returnFalse
+ return(
+ self.connect_timeout==other.connect_timeout
+ andself.disconnect_timeout==other.disconnect_timeout
+ andself.open_queue_timeout==other.open_queue_timeout
+ andself.configure_queue_timeout==other.configure_queue_timeout
+ andself.close_queue_timeout==other.close_queue_timeout
+ )
+
+ def__ne__(self,other:object)->bool:
+ returnnotself==other
+
+ def__repr__(self)->str:
+ attrs=(
+ "connect_timeout",
+ "disconnect_timeout",
+ "open_queue_timeout",
+ "configure_queue_timeout",
+ "close_queue_timeout",
+ )
+
+ params=[]
+ forattrinattrs:
+ value=getattr(self,attr)
+ ifvalueisnotNone:
+ params.append(f"{attr}={value!r}")
+
+ returnf"Timeouts({', '.join(params)})"
diff --git a/docs/docs/apidocs/python_apidocs/_sources/BUILD.md.txt b/docs/docs/apidocs/python_apidocs/_sources/BUILD.md.txt
index 2134c7e9c3..5a552d73ea 100644
--- a/docs/docs/apidocs/python_apidocs/_sources/BUILD.md.txt
+++ b/docs/docs/apidocs/python_apidocs/_sources/BUILD.md.txt
@@ -28,19 +28,17 @@ Run `tox -l` to see all available `tox` environments.
## Local Development
-The BlazingMQ C++ SDK provides a `./build-manylinux.sh` script and a
-`./build-macosx-universal.sh‘ script for setting up a
-development environmen.
+The BlazingMQ Python SDK provides a `./build-manylinux.sh` script and a
+`./build-macosx-universal.sh` script for setting up a development environment.
## Working with Make Targets
-When in an interactive command line prompt, you can use the following
-`make` targets to build and test the BlazingMQ Python SDK. Check the
-GitHub Actions configuration to set up the appropriate environment
-variables that may be needed prior to running these commands (such as
-setting `PYEXEC`). With a BlazingMQ broker running at
-‘tcp://localhost:30114‘, the following targets build and test the
-Python SDK:
+When in an interactive command line prompt, you can use the following `make`
+targets to build and test the BlazingMQ Python SDK. Check the
+appropriate GitHub Actions configuration to set up the appropriate environment
+variables that may be needed prior to running these commands (such as setting
+`PYEXEC`). With a BlazingMQ broker running at `tcp://localhost:30114`, the
+following targets build and test the Python SDK:
```shell
make test-install
diff --git a/docs/docs/apidocs/python_apidocs/_sources/api_reference.rst.txt b/docs/docs/apidocs/python_apidocs/_sources/api_reference.rst.txt
index 7171401a89..b380ab8c66 100644
--- a/docs/docs/apidocs/python_apidocs/_sources/api_reference.rst.txt
+++ b/docs/docs/apidocs/python_apidocs/_sources/api_reference.rst.txt
@@ -11,6 +11,14 @@ Session
.. autoclass:: Session
:members:
+.. autoclass:: Timeouts
+ :members:
+ :member-order: bysource
+
+.. autoclass:: SessionOptions
+ :members:
+ :member-order: bysource
+
.. autoclass:: QueueOptions
:members:
:member-order: bysource
diff --git a/docs/docs/apidocs/python_apidocs/acknowledgments.html b/docs/docs/apidocs/python_apidocs/acknowledgments.html
index 90e45e2ce6..f85c0db422 100644
--- a/docs/docs/apidocs/python_apidocs/acknowledgments.html
+++ b/docs/docs/apidocs/python_apidocs/acknowledgments.html
@@ -1,12 +1,14 @@
-
+
-
+
Acknowledgments — blazingmq 1.2.0 documentation
-
-
+
+
+
+
diff --git a/docs/docs/apidocs/python_apidocs/api_reference.html b/docs/docs/apidocs/python_apidocs/api_reference.html
index 4a110682c4..2e6e355593 100644
--- a/docs/docs/apidocs/python_apidocs/api_reference.html
+++ b/docs/docs/apidocs/python_apidocs/api_reference.html
@@ -1,12 +1,14 @@
-
+
-
+
API Reference — blazingmq 1.2.0 documentation
-
-
+
+
+
+
@@ -61,8 +63,11 @@
broker (str) – TCP address of the broker (default: ‘tcp://localhost:30114’).
+If the environment variable BMQ_BROKER_URI is set, its value
+will override whatever broker address is passed via this argument.
message_compression_algorithm (CompressionAlgorithmType) – the type of compression to apply to messages
being posted via this session object.
-
timeout (float) – maximum number of seconds to wait for requests on this
-session. If not provided, reasonable defaults are used.
+
timeout (Union[Timeouts, float]) – maximum number of seconds to wait for requests on this
+session. If not provided, reasonable defaults are used. This
+argument may either be a simple float, which sets the same
+timeout for each operation, or an instance of the Timeouts class,
+which allows setting the timeout for each operation independently.
host_health_monitor (Union[BasicHealthMonitor, None]) – A BasicHealthMonitor is used by default, so
your tests can control whether the session sees the machine as
healthy or not by calling set_healthy and set_unhealthy on
@@ -258,6 +268,26 @@
SessionHostHealthRestored events will never be emitted, and the
suspends_on_bad_host_health option of QueueOptions cannot be
used.
+
num_processing_threads (Optional[int]) – The number of threads for the SDK to use for
+processing events. This defaults to 1.
+
blob_buffer_size (Optional[int]) – The size (in bytes) of the blob buffers to use. This
+defaults to 4k.
+
channel_high_watermark (Optional[int]) – The size (in bytes) to use for the write cache
+high watermark on the channel. The default value is 128MB. Note
+that BlazingMQ reserves 4MB of this value for control messages, so
+the actual watermark for data published is
+channel_high_watermark-4MB.
+
event_queue_watermarks (Optional[tuple[int, int]]) – A tuple containing the low and high
+notification watermark thresholds for the buffer containing all
+incoming messages from the broker, respectively. A warning
+SlowConsumerHighWaterMark is emitted when the buffer reaches the
+high watermark value, and a notification SlowConsumerNormal is
+emitted when the buffer is back to the low watermark.
+
stats_dump_interval (Optional[float]) – The interval (in seconds) at which to dump stats
+into the logs. If 0, disable the recurring dump of stats (final
+stats are always dumped at the end of the session). The default is
+5min; the value must be a multiple of 30s, in the range
+[0s-60min].
Raises:
@@ -265,7 +295,8 @@
Session
Error – If the session start request was not successful.
BrokerTimeoutError – If the broker didn’t respond
to the request within a reasonable amount of time.
-
ValueError – If timeout is provided and not > 0.0.
+
ValueError – If any of the timeouts are provided and not > 0.0, or if
+ the stats_dump_interval is provided and is < 0.0.
This is the recommended way to construct a new session, as the
+SessionOptions class provides an easier to use interface for
+configuring only those options you need.
+
+
Parameters:
+
+
on_session_event (Callable[[SessionEvent], None]) – a required callback to process SessionEvent events
+received by the session.
broker (str) – TCP address of the broker (default: ‘tcp://localhost:30114’).
+If the environment variable BMQ_BROKER_URI is set, its value
+will override whatever broker address is passed via this argument.
A value semantic type representing session timeouts.
+
Each option can be set either by passing it as a keyword argument when
+constructing a Timeouts instance, or by setting it as an attribute on
+a constructed instance.
+
The default for every option is None. When constructing a Session,
+either directly or using SessionOptions, options set to None are given
+reasonable default values.
+
+
Parameters:
+
+
connect_timeout (Optional[float]) – The maximum number of seconds to wait for connection requests on
+this session.
+
disconnect_timeout (Optional[float]) – The maximum number of seconds to wait for disconnection requests
+on this session.
+
open_queue_timeout (Optional[float]) – The maximum number of seconds to wait for open queue requests on
+this session.
+
configure_queue_timeout (Optional[float]) – The maximum number of seconds to wait for configure queue requests
+on this session.
+
close_queue_timeout (Optional[float]) – The maximum number of seconds to wait for close queue requests on
+this session.
A value semantic type representing session options.
+
Each option can be set either by passing it as a keyword argument when
+constructing a SessionOptions instance, or by setting it as an attribute
+on a constructed instance.
+
The default for every option is None. When constructing a Session,
+options set to None are given reasonable default values.
+
+
Parameters:
+
+
message_compression_algorithm (Optional[CompressionAlgorithmType]) – The type of compression to apply to messages being posted via the
+session this object is configuring.
+
timeouts (Optional[Timeouts]) – The maximum number of seconds to wait for requests for each
+operation on this session. If not provided, reasonable defaults
+are used.
+
host_health_monitor (Union[BasicHealthMonitor, None]) – A BasicHealthMonitor is used by default, so your tests can
+control whether the session sees the machine as healthy or not by
+calling set_healthy and set_unhealthy on that instance. If
+you instead pass None, the session will always see the machine as
+healthy, HostUnhealthy and HostHealthRestored events with
+never be emitted, and the suspends_on_bad_host_health option of
+QueueOptions cannot be used.
+
num_processing_threads (Optional[int]) – The number of threads for the SDK to use for processing events.
+This defaults to 1.
+
blob_buffer_size (Optional[int]) – The size (in bytes) of the blob buffers to use. This defaults to
+4k.
+
channel_high_watermark (Optional[int]) – The size (in bytes) to use for the write cache high watermark on
+the channel. The default value is 128MB. Note that BlazingMQ
+reserves 4MB of this value for control messages, so the actual
+watermark for data published is channel_high_watermark-4MB.
+
event_queue_watermarks (Optional[tuple[int, int]]) – A tuple containing the low and high notification watermark
+thresholds for the buffer containing all incoming messages from the
+broker, respectively. A warning SlowConsumerHighWaterMark is
+emitted when the buffer reaches the high watermark value, and a
+notification SlowConsumerNormal is emitted when the buffer is
+back to the low watermark.
+
stats_dump_interval (Optional[float]) – The interval (in seconds) at which to dump stats into the logs. If
+0, disable the recurring dump of stats (final stats are always
+dumped at the end of the session). The default is 5min; the value
+must be a multiple of 30s, in the range [0s-60min].