Skip to content

Commit e64d447

Browse files
committed
temp
1 parent 8512408 commit e64d447

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Diff for: ydb/_topic_writer/topic_writer_asyncio.py

+4
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ async def wait_init(self) -> PublicWriterInitInfo:
164164
return await self._reconnector.wait_init()
165165

166166

167+
class TxWriterAsyncIO(WriterAsyncIO):
168+
...
169+
170+
167171
class WriterAsyncIOReconnector:
168172
_closed: bool
169173
_loop: asyncio.AbstractEventLoop

Diff for: ydb/topic.py

+20
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,26 @@ def writer(
276276

277277
return TopicWriterAsyncIO(self._driver, settings, _client=self)
278278

279+
def tx_writer(
280+
self,
281+
tx,
282+
topic,
283+
*,
284+
producer_id: Optional[str] = None, # default - random
285+
session_metadata: Mapping[str, str] = None,
286+
partition_id: Union[int, None] = None,
287+
auto_seqno: bool = True,
288+
auto_created_at: bool = True,
289+
codec: Optional[TopicCodec] = None, # default mean auto-select
290+
# encoders: map[codec_code] func(encoded_bytes)->decoded_bytes
291+
# the func will be called from multiply threads in parallel.
292+
encoders: Optional[Mapping[_ydb_topic_public_types.PublicCodec, Callable[[bytes], bytes]]] = None,
293+
# custom encoder executor for call builtin and custom decoders. If None - use shared executor pool.
294+
# If max_worker in the executor is 1 - then encoders will be called from the thread without parallel.
295+
encoder_executor: Optional[concurrent.futures.Executor] = None,
296+
) -> TopicTxWriterAsyncIO:
297+
298+
279299
def close(self):
280300
if self._closed:
281301
return

0 commit comments

Comments
 (0)