@@ -116,7 +116,8 @@ class MapAsync(Operator): # pylint: disable=too-many-instance-attributes
116116 :param mode: behavior when a value is currently processed
117117 :param error_callback: error callback to be registered
118118 :param unpack: value from emits will be unpacked as (\\ *value)
119- :param max_queue_size: queue len error threshold, used with AsyncMode.QUEUE
119+ :param max_queue_threshold: queue len error threshold,
120+ used with AsyncMode.QUEUE
120121 :param \\ *\\ *kwargs: keyword arguments to be used for calling coro
121122
122123 :ivar scheduled: Publisher emitting the value when coroutine is actually
@@ -125,11 +126,11 @@ class MapAsync(Operator): # pylint: disable=too-many-instance-attributes
125126 def __init__ (self ,
126127 coro , * args , mode = AsyncMode .CONCURRENT ,
127128 error_callback = default_error_handler , unpack : bool = False ,
128- max_queue_size : int | None = None , ** kwargs ) -> None :
129+ max_queue_threshold : int | None = None , ** kwargs ) -> None :
129130 Operator .__init__ (self )
130131 _coro = wrap_coro (coro , unpack , * args , ** kwargs )
131132 self ._coro_queue = CoroQueue (
132- _coro , mode = mode , max_queue_size = max_queue_size
133+ _coro , mode = mode , max_queue_threshold = max_queue_threshold
133134 )
134135 self ._error_callback = error_callback
135136
@@ -154,18 +155,19 @@ def build_map_async(coro=None, *,
154155 mode : AsyncMode = AsyncMode .CONCURRENT ,
155156 error_callback = default_error_handler ,
156157 unpack : bool = False ,
157- max_queue_size : int | None = None ):
158+ max_queue_threshold : int | None = None ):
158159 """ Decorator to wrap a function to return a Map operator.
159160
160161 :param coro: coroutine to be wrapped
161162 :param mode: behavior when a value is currently processed
162163 :param error_callback: error callback to be registered
163164 :param unpack: value from emits will be unpacked (*value)
164- :param max_queue_size: queue len error threshold, used with AsyncMode.QUEUE
165+ :param max_queue_threshold: queue len error threshold,
166+ used with AsyncMode.QUEUE
165167 """
166168 def _build_map_async (coro ):
167169 return MapAsync (coro , mode = mode , error_callback = error_callback ,
168- unpack = unpack , max_queue_size = max_queue_size )
170+ unpack = unpack , max_queue_threshold = max_queue_threshold )
169171
170172 if coro :
171173 return _build_map_async (coro )
@@ -177,32 +179,33 @@ def build_map_async_factory(coro=None, *,
177179 mode : AsyncMode = AsyncMode .CONCURRENT ,
178180 error_callback = default_error_handler ,
179181 unpack : bool = False ,
180- max_queue_size : int | None = None ):
182+ max_queue_threshold : int | None = None ):
181183 """ Decorator to wrap a coroutine to return a factory for MapAsync
182184 operators.
183185
184186 :param coro: coroutine to be wrapped
185187 :param mode: behavior when a value is currently processed
186188 :param error_callback: error callback to be registered
187189 :param unpack: value from emits will be unpacked (*value)
188- :param max_queue_size: queue len error threshold, used with AsyncMode.QUEUE
190+ :param max_queue_threshold: queue len error threshold,
191+ used with AsyncMode.QUEUE
189192 """
190193 _mode = mode
191194
192195 def _build_map_async (coro ):
193196 @wraps (coro )
194197 def _wrapper (* args , mode = None , ** kwargs ) -> MapAsync :
195198 if ('unpack' in kwargs ) or ('error_callback' in kwargs ) or \
196- ('max_queue_size ' in kwargs ):
199+ ('max_queue_threshold ' in kwargs ):
197200 raise TypeError (
198- '"unpack", "error_callback" or "max_queue_size" has to '
199- 'be defined by decorator'
201+ '"unpack", "error_callback" or "max_queue_threshold" '
202+ 'has to be defined by decorator'
200203 )
201204 if mode is None :
202205 mode = _mode
203206 return MapAsync (coro , * args , mode = mode , unpack = unpack ,
204207 error_callback = error_callback ,
205- max_queue_size = max_queue_size , ** kwargs )
208+ max_queue_threshold = max_queue_threshold , ** kwargs )
206209 return _wrapper
207210
208211 if coro :
0 commit comments