per page, with , order by , clip by
Results of 1 - 5 of about 5 for consumer (0.004 sec.)
asyncio とフリースレッド Python 12832
asyncio とフリースレッド Python asyncio uses an event loop as a scheduler to enable highly efficient concurrency by switching between tasks to allow non-blocking I/O operations. This results in better performance for I/O-bound use cases. It ... ue . Queue [ int ]) -> None : for i in range ( 5 ): print ( f "Producing { i } " ) q . put ( i ) q . shutdown () async def consumer ( q : queue . Queue [ int ]) -> None : while True : try : item = q . get_nowait () except queue . Empty : await asyncio . ... tDown : break print ( f "Consumed { item } " ) await asyncio . sleep ( item ) q : queue . Queue [ int ] = queue . Queue () consumer_thread = threading . Thread ( target = lambda : asyncio . run ( consumer ( q )) ) consumer_thread . start () producer ( q ... ) consumer_thread . join () The producer runs on the main thread while the consumer runs inside an event loop on its own thread, yet ...
https://man.mtool.work/python/3.14/library/asyncio-threading.html
asyncio での開発 8677
asyncio での開発 非同期プログラミングは、従来の「逐次的」なプログラミングとは異なります。 このページはよくある間違いや落とし穴を列挙し、それらを回避する方法を説明します。 デバッグモード asyncio はデフォルトで本運用モードで実行されます。いっ ... o an inconsistent state of the async generator and can cause errors. 次の例を考えてみてください。 import asyncio async def consumer (): for idx in range ( 100 ): await asyncio . sleep ( 0 ) message = yield idx print ( 'received' , message ) async def ama ... in (): agenerator = consumer () await agenerator . asend ( None ) fa = asyncio . create_task ( agenerator . asend ( 'A' )) fb = asyncio . create_task ( ...
https://man.mtool.work/python/3.14/library/asyncio-dev.html
importlib.metadata -- パッケージメタデータへのアクセス 8273
importlib.metadata -- パッケージメタデータへのアクセス Added in version 3.8. バージョン 3.10 で変更: importlib.metadata は暫定的なものではなくなりました。 ソースコード: Lib/importlib/metadata/__init__.py importlib.metadata は、インストール済 ... h and .name properties indicating the path to search and name to match and may supply other relevant context sought by the consumer. In practice, to support finding distribution package metadata in locations other than the file system, subclass Distribut ...
https://man.mtool.work/python/3.14/library/importlib.metadata.html
multiprocessing --- プロセスベースの並列処理 8070
multiprocessing --- プロセスベースの並列処理 ソースコード: Lib/multiprocessing/ 利用可能な環境 : not Android, not iOS, not WASI. このモジュールは モバイルプラットフォーム と WebAssemblyプラットフォーム をサポートしません。 はじめに multipro ... のやりとりのために Pipe() (2つのプロセス間の通信用)、もしくはキュー (複数のメッセージ生成プロセス (producer)、消費プロセス (consumer) の実現用) を使うことができます。 Queue , SimpleQueue と JoinableQueue 型は複数プロセスから生成/消費を行う FIFO キューです ...
https://man.mtool.work/python/3.14/library/multiprocessing.html
pickle --- Python オブジェクトの直列化 8070
pickle --- Python オブジェクトの直列化 ソースコード: Lib/pickle.py pickle モジュールは、Python オブジェクト構造を直列化・復元するためのバイナリプロトコルを実装しています。 pickle 化 (pickling) とは Python オブジェクトの階層をバイトストリーム ... ータのコピーと、ストリームからのデータのコピーが本質的に伴います。 この制約は、 provider (転送するオブジェクトの型の実装) と consumer (通信システムの実装) の両方が、pickle プロトコル 5 以降の帯域外転送機能をサポートしていれば回避できます。 生産者 API pickl ...
https://man.mtool.work/python/3.14/library/pickle.html
PREV 1 NEXT