Results of 1 - 10 of about 29 for futures (0.006 sec.)
- concurrent.futures --- 並列タスク実行 15973
- concurrent.futures --- 並列タスク実行 Added in version 3.2. ソースコード: Lib/concurrent/futures/thread.py 、 Lib/concurrent/futures/process.py および Lib/concurrent/futures/interpreter.py concurrent.futures モジュールは、呼び出し可能オブジ
...r による別プロセスを使えます。 いずれも、抽象クラス Executor で定義された同じインターフェースを実装しています。 concurrent.futures.Future と asyncio.Future を混同しないでください。 後者は asyncio のタスクやコルーチンとともに使うよう設計されています。 両...動作しないか、利用不可です。詳しくは、 WebAssembly プラットフォーム を見てください。 Executor オブジェクト class concurrent.futures. Executor 非同期呼び出しを実行するためのメソッドを提供する抽象クラスです。このクラスを直接使ってはならず、具象サブクラスを...ksize 引数が追加されました。 バージョン 3.14 で変更: buffersize 引数が追加されました。 shutdown ( wait = True , * , cancel_futures = False ) executor に対して、現在保留中のフューチャーが実行された後で、使用中のすべての資源を解放するように伝えます。シャッ... - https://man.mtool.work/python/3.14/library/concurrent.futures.html
- Future 11078
- Future ソースコード: Lib/asyncio/futures.py , Lib/asyncio/base_futures.py Future オブジェクトは 低水準のコールバックベースのコード と高水準の async/await コードとの間を橋渡しします。 Future の関数 asyncio. isfuture ( obj ) オブジェクト obj
...ず、実行中のイベントループもない場合に、非推奨の警告が出ます。 asyncio. wrap_future ( future , * , loop = None ) concurrent.futures.Future オブジェクトを asyncio.Future オブジェクトでラップします。 バージョン 3.10 で非推奨: future が Future に相当するオブ...結果が得られるまで待ち (1 秒)、表示する。 print ( await fut ) asyncio . run ( main ()) 重要 Future オブジェクトは concurrent.futures.Future を模倣してデザインされました。両者の重要な違いは以下の通りです: asyncio の Futures と異なり、 concurrent.futures.Fu...即座に呼び出されません。代わりにコールバックは loop.call_soon() によりスケジュールされます。 asyncio の Future は concurrent.futures.wait() および concurrent.futures.as_completed() との互換性がありません。 asyncio.Future.cancel() は省略可能な msg 引数を受... - https://man.mtool.work/python/3.14/library/asyncio-future.html
- concurrent パッケージ 8761
- concurrent パッケージ このパッケージには、以下のモジュールが含まれています: concurrent.futures -- 並列タスク実行 concurrent.interpreters -- 同じプロセス内の複数のインタープリタ 他のマニュアルの関連ページ Django 4.2.13 Django 5.0.6 PHP snmp.
... - https://man.mtool.work/python/3.14/library/concurrent.html
- asyncio での開発 8304
- asyncio での開発 非同期プログラミングは、従来の「逐次的」なプログラミングとは異なります。 このページはよくある間違いや落とし穴を列挙し、それらを回避する方法を説明します。 デバッグモード asyncio はデフォルトで本運用モードで実行されます。いっ
...は、 run_coroutine_threadsafe() メソッドを使ってください。 run_coroutine_threadsafe() は結果にアクセスするための concurrent.futures.Future オブジェクトを返します: async def coro_func (): return await asyncio . sleep ( 1 , 42 ) # 後で、別の OS スレッド内で...の処理を行うには、イベントループはメインスレッド内で実行しなければなりません。 loop.run_in_executor() メソッドを concurrent.futures.ThreadPoolExecutor または InterpreterPoolExecutor と組み合わせると、イベントループの OS スレッドをブロックせずに、別の OS...らプロセスを開始したりプロセスと通信したりする方法を提供します。 最後に、前述の loop.run_in_executor() メソッドは concurrent.futures.ProcessPoolExecutor とともに使用することで、別のプロセス内でコードを実行することもできます。 ブロッキングコードの実行 ブロ... - https://man.mtool.work/python/3.14/library/asyncio-dev.html
- イベントループ 8304
- イベントループ ソースコード: Lib/asyncio/events.py , Lib/asyncio/base_events.py まえがき イベントループは全ての asyncio アプリケーションの中核をなす存在です。イベントループは非同期タスクやコールバックを実行し、ネットワーク I/O を処理し、サブ
...syncio でフューチャーオブジェクトを作成するために推奨される方法です。このメソッドにより、サードパーティ製のイベントループがFutures クラスの(パフォーマンスや計測方法が優れた) 代替実装を提供することを可能にします。 Added in version 3.5.2. loop. create_tas...c , * args ) 指定した Executor 内で、 args を位置引数として func を呼び出すように手配します。 executor 引数には concurrent.futures.Executor のインスタンスを指定します。 None の場合はデフォルトの Executor を使います。 デフォルトの Executor は loop.set_de...fault_executor() で設定できます。 設定しなければ、 run_in_executor() が必要になった時点で concurrent.futures.ThreadPoolExecutor を初期化して使います。 以下はプログラム例です: import asyncio import concurrent.futures def blocking_io... - https://man.mtool.work/python/3.14/library/asyncio-eventloop.html
- Python ドキュメントの目次 8108
- Python ドキュメントの目次 What's New in Python What's new in Python 3.14 概要 -- リリースハイライト 新しい機能 PEP 649 と PEP 749 : アノテーションの遅延評価 PEP 734 : 複数インタープリタ機能が標準ライブラリに追加 PEP 750 : テンプレート文字列
...ガベージコレクション デフォルトの対話型シェル 新しいモジュール 改良されたモジュール argparse ast asyncio calendar concurrent.futures configparser contextvars ctypes curses datetime decimal difflib dis errno faulthandler fnmatch fractions functools getopt...ムのサポート その他の言語変更 新たなモジュール 改良されたモジュール argparse array ast asyncio base64 compileall concurrent.futures configparser copy ctypes dbm dis doctest email enum fractions glob importlib io ipaddress itertools marshal math mimetypes...新しいパーサー その他の言語変更 新たなモジュール zoneinfo graphlib 改良されたモジュール ast asyncio compileall concurrent.futures curses datetime distutils fcntl ftplib gc hashlib http IDLE と idelelib imaplib importlib inspect ipaddress math multiproc... - https://man.mtool.work/python/3.14/contents.html
- What's New In Python 3.2 8027
- What's New In Python 3.2 著者 : Raymond Hettinger この記事では Python 3.1 と比較した Python 3.2 の新機能を説明します。 Python 3.2 は 2011 年 2 月 20 日にリリースされました。 主な変更点をいくつか取り上げ、例を示します。 すべての詳細については
...t CRITICAL Abnormal termination 参考 PEP 391 - logging の辞書ベースの設定 PEP written by Vinay Sajip. PEP 3148: concurrent.futures モジュール 同時並行性 (concurrency) を生成・管理するコードはトップレベルの新しい名前空間 concurrent に集められることになり...ました。その最初のメンバーが futures パッケージです。これはスレッドとプロセス管理の統一的な高水準インターフェイスを提供します。 concurrent.futures の設計は Jav...来ます。 以下はファイルコピーを行う 4 つの並列スレッドを実行する、 ThreadPoolExecutor の単純な使用例です: import concurrent.futures , shutil with concurrent . futures . ThreadPoolExecutor ( max_workers = 4 ) as e : e . submit ( shutil . copy , 'src1.txt'... - https://man.mtool.work/python/3.14/whatsnew/3.2.html
- __main__ --- トップレベルのコード環境 7929
- __main__ --- トップレベルのコード環境 Python では、 __main__ という特別な名前が次の二つの重要な用途で使われます: プログラムのトップレベル環境の名前。 __name__ == '__main__' という式でチェックすることができる。 Python パッケージにおける __ma
...インポートされるファイルがパッケージの一部である場合は、 __name__ にはそのパッケージのパスも含まれます: >>> from concurrent.futures import process >>> process . __name__ 'concurrent.futures.process' しかし、モジュールがトップレベルのスクリプト環境で実行さ... - https://man.mtool.work/python/3.14/library/__main__.html
- コルーチンとタスク 7929
- コルーチンとタスク この節では、コルーチンと Task を利用する高レベルの asyncio の API の概略を解説します。 コルーチン ソースコード: Lib/asyncio/coroutines.py async/await 構文で宣言された コルーチン は、 asyncio を使ったアプリケーションを書く
...れたイベントループにコルーチンを送ります。 この処理は、スレッドセーフです。 他の OS スレッドから結果を待つための concurrent.futures.Future を返します。 この関数は、イベントループが動作しているスレッドとは異なる OS スレッドから呼び出すためのものです。 例え...。 @contextlib . contextmanager def loop_in_thread () -> Generator [ asyncio . AbstractEventLoop ]: loop_fut = concurrent . futures . Future [ asyncio . AbstractEventLoop ]() stop_event = asyncio . Event () async def main () -> None : loop_fut . set_resu...lt ( asyncio . get_running_loop ()) await stop_event . wait () with concurrent . futures . ThreadPoolExecutor ( 1 ) as tpe : complete_fut = tpe . submit ( asyncio . run , main ()) for fut in concurrent . futures... - https://man.mtool.work/python/3.14/library/asyncio-task.html
- 並行実行 7929
- 並行実行 この章で説明するモジュールは、コードの並行実行をサポートします。 適切なツールは、実行するタスク (CPU バウンドか I/O バウンドか) と、好みの開発スタイル (イベント駆動の協調的マルチタスクかプリエンプティブマルチタスクか) によって異なり
...の場合 使用例 multiprocessing.shared_memory --- プロセス間で直接アクセス可能な共有メモリ concurrent パッケージ concurrent.futures --- 並列タスク実行 Executor オブジェクト ThreadPoolExecutor ThreadPoolExecutor の例 InterpreterPoolExecutor ProcessPoolExe... - https://man.mtool.work/python/3.14/library/concurrency.html