@@ -170,8 +170,11 @@ def reader(
170
170
consumer : str ,
171
171
buffer_size_bytes : int = 50 * 1024 * 1024 ,
172
172
# decoders: map[codec_code] func(encoded_bytes)->decoded_bytes
173
+ # the func will be called from multiply threads in parallel
173
174
decoders : Union [Mapping [int , Callable [[bytes ], bytes ]], None ] = None ,
174
- decoder_executor : Optional [concurrent .futures .Executor ] = None , # default shared client executor pool
175
+ # custom decoder executor for call builtin and custom decoders. If None - use shared executor pool.
176
+ # if max_worker in the executor is 1 - then decoders will be called from the thread without parallel
177
+ decoder_executor : Optional [concurrent .futures .Executor ] = None ,
175
178
) -> TopicReaderAsyncIO :
176
179
177
180
if not decoder_executor :
@@ -194,8 +197,12 @@ def writer(
194
197
auto_seqno : bool = True ,
195
198
auto_created_at : bool = True ,
196
199
codec : Optional [TopicCodec ] = None , # default mean auto-select
200
+ # encoders: map[codec_code] func(encoded_bytes)->decoded_bytes
201
+ # the func will be called from multiply threads in parallel.
197
202
encoders : Optional [Mapping [_ydb_topic_public_types .PublicCodec , Callable [[bytes ], bytes ]]] = None ,
198
- encoder_executor : Optional [concurrent .futures .Executor ] = None , # default shared client executor pool
203
+ # custom encoder executor for call builtin and custom decoders. If None - use shared executor pool.
204
+ # If max_worker in the executor is 1 - then encoders will be called from the thread without parallel.
205
+ encoder_executor : Optional [concurrent .futures .Executor ] = None ,
199
206
) -> TopicWriterAsyncIO :
200
207
args = locals ().copy ()
201
208
del args ["self" ]
@@ -319,7 +326,10 @@ def reader(
319
326
consumer : str ,
320
327
buffer_size_bytes : int = 50 * 1024 * 1024 ,
321
328
# decoders: map[codec_code] func(encoded_bytes)->decoded_bytes
329
+ # the func will be called from multiply threads in parallel
322
330
decoders : Union [Mapping [int , Callable [[bytes ], bytes ]], None ] = None ,
331
+ # custom decoder executor for call builtin and custom decoders. If None - use shared executor pool.
332
+ # if max_worker in the executor is 1 - then decoders will be called from the thread without parallel
323
333
decoder_executor : Optional [concurrent .futures .Executor ] = None , # default shared client executor pool
324
334
) -> TopicReader :
325
335
if not decoder_executor :
@@ -343,7 +353,11 @@ def writer(
343
353
auto_seqno : bool = True ,
344
354
auto_created_at : bool = True ,
345
355
codec : Optional [TopicCodec ] = None , # default mean auto-select
356
+ # encoders: map[codec_code] func(encoded_bytes)->decoded_bytes
357
+ # the func will be called from multiply threads in parallel.
346
358
encoders : Optional [Mapping [_ydb_topic_public_types .PublicCodec , Callable [[bytes ], bytes ]]] = None ,
359
+ # custom encoder executor for call builtin and custom decoders. If None - use shared executor pool.
360
+ # If max_worker in the executor is 1 - then encoders will be called from the thread without parallel.
347
361
encoder_executor : Optional [concurrent .futures .Executor ] = None , # default shared client executor pool
348
362
) -> TopicWriter :
349
363
args = locals ().copy ()
0 commit comments