-
-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathasyncio-task.po
More file actions
993 lines (846 loc) · 42.3 KB
/
asyncio-task.po
File metadata and controls
993 lines (846 loc) · 42.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2020, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# tomo, 2019
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-09 18:48+0900\n"
"PO-Revision-Date: 2018-06-29 17:40+0000\n"
"Last-Translator: tomo, 2019\n"
"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/"
"ja/)\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/asyncio-task.rst:4
msgid "Tasks and coroutines"
msgstr "タスクとコルーチン"
#: ../../library/asyncio-task.rst:6
msgid "**Source code:** :source:`Lib/asyncio/tasks.py`"
msgstr ""
#: ../../library/asyncio-task.rst:8
msgid "**Source code:** :source:`Lib/asyncio/coroutines.py`"
msgstr ""
#: ../../library/asyncio-task.rst:13
msgid "Coroutines"
msgstr "コルーチン"
#: ../../library/asyncio-task.rst:15
msgid ""
"Coroutines used with :mod:`asyncio` may be implemented using the :keyword:"
"`async def` statement, or by using :term:`generators <generator>`. The :"
"keyword:`async def` type of coroutine was added in Python 3.5, and is "
"recommended if there is no need to support older Python versions."
msgstr ""
":mod:`asyncio` と一緒に使うコルーチンは :keyword:`async def` 文を使って実装す"
"るか、もしくは :term:`ジェネレータ <generator>` を使って実装します。:"
"keyword:`async def` 型のコルーチンはPython 3.5の時に追加されました。3.5より前"
"のバージョンのPythonをサポートする必要がなければ :keyword:`async def` タイプ"
"のコルーチンが推奨されています。"
#: ../../library/asyncio-task.rst:20
msgid ""
"Generator-based coroutines should be decorated with :func:`@asyncio."
"coroutine <asyncio.coroutine>`, although this is not strictly enforced. The "
"decorator enables compatibility with :keyword:`async def` coroutines, and "
"also serves as documentation. Generator-based coroutines use the ``yield "
"from`` syntax introduced in :pep:`380`, instead of the original ``yield`` "
"syntax."
msgstr ""
"必須というわけではありませんが、ジェネレータベースのコルーチンは :func:"
"`@asyncio.coroutine <asyncio.coroutine>` でデコレートすべきです。 :func:"
"`@asyncio.coroutine <asyncio.coroutine>` でデコレートすることで :keyword:"
"`async def` 型のコルーチンと互換性を持たせることができ、ドキュメントとしても"
"役に立ちます。ジェネレータベースのコルーチンは ``yield`` 構文を使う代わり"
"に、 :pep:`380` で導入された ``yield from`` 構文を使います。"
#: ../../library/asyncio-task.rst:27
msgid ""
"The word \"coroutine\", like the word \"generator\", is used for two "
"different (though related) concepts:"
msgstr ""
"単語 \"コルーチン\" は単語 \"ジェネレーター\" のように、(関連はしていますが) "
"異なる 2 つの概念で使用されます:"
#: ../../library/asyncio-task.rst:30
msgid ""
"The function that defines a coroutine (a function definition using :keyword:"
"`async def` or decorated with ``@asyncio.coroutine``). If disambiguation is "
"needed we will call this a *coroutine function* (:func:`iscoroutinefunction` "
"returns ``True``)."
msgstr ""
"コルーチンを定義した関数 (:keyword:`async def` を使用するか ``@asyncio."
"coroutine`` でデコレートされた関数定義)。\n"
"曖昧さを避ける際は *コルーチン関数* と呼びます (:func:`iscoroutinefunction` "
"は ``True`` を返します)。"
#: ../../library/asyncio-task.rst:36
msgid ""
"The object obtained by calling a coroutine function. This object represents "
"a computation or an I/O operation (usually a combination) that will complete "
"eventually. If disambiguation is needed we will call it a *coroutine "
"object* (:func:`iscoroutine` returns ``True``)."
msgstr ""
"コルーチン関数の呼び出しによって取得されたオブジェクト。このオブジェクトは、"
"いつかは完了する計算または I/O 操作 (通常はその組み合わせ) を表します。曖昧さ"
"の解消が必要な場合はこれを *コルーチンオブジェクト* (:func:`iscoroutine` が "
"``True`` を返す) と呼びます。"
#: ../../library/asyncio-task.rst:41
msgid "Things a coroutine can do:"
msgstr "コルーチンができること:"
#: ../../library/asyncio-task.rst:43
msgid ""
"``result = await future`` or ``result = yield from future`` -- suspends the "
"coroutine until the future is done, then returns the future's result, or "
"raises an exception, which will be propagated. (If the future is cancelled, "
"it will raise a ``CancelledError`` exception.) Note that tasks are futures, "
"and everything said about futures also applies to tasks."
msgstr ""
#: ../../library/asyncio-task.rst:50
msgid ""
"``result = await coroutine`` or ``result = yield from coroutine`` -- wait "
"for another coroutine to produce a result (or raise an exception, which will "
"be propagated). The ``coroutine`` expression must be a *call* to another "
"coroutine."
msgstr ""
#: ../../library/asyncio-task.rst:55
msgid ""
"``return expression`` -- produce a result to the coroutine that is waiting "
"for this one using :keyword:`await` or ``yield from``."
msgstr ""
#: ../../library/asyncio-task.rst:58
msgid ""
"``raise exception`` -- raise an exception in the coroutine that is waiting "
"for this one using :keyword:`await` or ``yield from``."
msgstr ""
#: ../../library/asyncio-task.rst:61
msgid ""
"Calling a coroutine does not start its code running -- the coroutine object "
"returned by the call doesn't do anything until you schedule its execution. "
"There are two basic ways to start it running: call ``await coroutine`` or "
"``yield from coroutine`` from another coroutine (assuming the other "
"coroutine is already running!), or schedule its execution using the :func:"
"`ensure_future` function or the :meth:`AbstractEventLoop.create_task` method."
msgstr ""
#: ../../library/asyncio-task.rst:70
msgid "Coroutines (and tasks) can only run when the event loop is running."
msgstr ""
"コルーチン (およびタスク) はイベントループが実行中の場合にのみ起動できます。"
#: ../../library/asyncio-task.rst:74
msgid ""
"Decorator to mark generator-based coroutines. This enables the generator "
"use :keyword:`!yield from` to call :keyword:`async def` coroutines, and also "
"enables the generator to be called by :keyword:`async def` coroutines, for "
"instance using an :keyword:`await` expression."
msgstr ""
#: ../../library/asyncio-task.rst:80
msgid ""
"There is no need to decorate :keyword:`async def` coroutines themselves."
msgstr ":keyword:`async def` コルーチン自身をデコレートする必要はありません。"
#: ../../library/asyncio-task.rst:82
msgid ""
"If the generator is not yielded from before it is destroyed, an error "
"message is logged. See :ref:`Detect coroutines never scheduled <asyncio-"
"coroutine-not-scheduled>`."
msgstr ""
#: ../../library/asyncio-task.rst:88
msgid ""
"In this documentation, some methods are documented as coroutines, even if "
"they are plain Python functions returning a :class:`Future`. This is "
"intentional to have a freedom of tweaking the implementation of these "
"functions in the future. If such a function is needed to be used in a "
"callback-style code, wrap its result with :func:`ensure_future`."
msgstr ""
#: ../../library/asyncio-task.rst:98
msgid "Example: Hello World coroutine"
msgstr "例: Hello World コルーチン"
#: ../../library/asyncio-task.rst:100
msgid "Example of coroutine displaying ``\"Hello World\"``::"
msgstr "``\"Hello World\"`` と表示するコルーチンの例::"
#: ../../library/asyncio-task.rst:114
msgid ""
"The :ref:`Hello World with call_soon() <asyncio-hello-world-callback>` "
"example uses the :meth:`AbstractEventLoop.call_soon` method to schedule a "
"callback."
msgstr ""
#: ../../library/asyncio-task.rst:122
msgid "Example: Coroutine displaying the current date"
msgstr "例: 現在の日時を表示するコルーチン"
#: ../../library/asyncio-task.rst:124
msgid ""
"Example of coroutine displaying the current date every second during 5 "
"seconds using the :meth:`sleep` function::"
msgstr ""
":meth:`sleep` 関数を用いて現在の時刻を5秒間、毎秒表示するコルーチンの例::"
#: ../../library/asyncio-task.rst:145
msgid ""
"The :ref:`display the current date with call_later() <asyncio-date-"
"callback>` example uses a callback with the :meth:`AbstractEventLoop."
"call_later` method."
msgstr ""
#: ../../library/asyncio-task.rst:151
msgid "Example: Chain coroutines"
msgstr "例: コルーチンのチェーン"
#: ../../library/asyncio-task.rst:153
msgid "Example chaining coroutines::"
msgstr "コルーチンをチェーンする例です::"
#: ../../library/asyncio-task.rst:170
msgid ""
"``compute()`` is chained to ``print_sum()``: ``print_sum()`` coroutine waits "
"until ``compute()`` is completed before returning its result."
msgstr ""
"``compute()`` は ``print_sum()`` にチェーンされます: ``print_sum()`` コルーチ"
"ンは ``compute()`` が完了するまで待ちます。"
#: ../../library/asyncio-task.rst:173
msgid "Sequence diagram of the example:"
msgstr "この例のシーケンス図です:"
#: ../../library/asyncio-task.rst:178
msgid ""
"The \"Task\" is created by the :meth:`AbstractEventLoop.run_until_complete` "
"method when it gets a coroutine object instead of a task."
msgstr ""
#: ../../library/asyncio-task.rst:181
msgid ""
"The diagram shows the control flow, it does not describe exactly how things "
"work internally. For example, the sleep coroutine creates an internal future "
"which uses :meth:`AbstractEventLoop.call_later` to wake up the task in 1 "
"second."
msgstr ""
#: ../../library/asyncio-task.rst:187
msgid "InvalidStateError"
msgstr "InvalidStateError"
#: ../../library/asyncio-task.rst:191
msgid "The operation is not allowed in this state."
msgstr "操作はこの状態では許可されません。"
#: ../../library/asyncio-task.rst:195
msgid "TimeoutError"
msgstr "TimeoutError"
#: ../../library/asyncio-task.rst:199
msgid "The operation exceeded the given deadline."
msgstr "操作は与えられた期限を超えました。"
#: ../../library/asyncio-task.rst:203
msgid ""
"This exception is different from the builtin :exc:`TimeoutError` exception!"
msgstr "この例外は組み込みの :exc:`TimeoutError` 例外とは異なります!"
#: ../../library/asyncio-task.rst:207
msgid "Future"
msgstr "フューチャー"
#: ../../library/asyncio-task.rst:211
msgid ""
"This class is *almost* compatible with :class:`concurrent.futures.Future`."
msgstr "このクラスは :class:`concurrent.futures.Future` と *ほぼ* 互換です。"
#: ../../library/asyncio-task.rst:213
msgid "Differences:"
msgstr "相違点:"
#: ../../library/asyncio-task.rst:215
msgid ""
":meth:`result` and :meth:`exception` do not take a timeout argument and "
"raise an exception when the future isn't done yet."
msgstr ""
":meth:`result` および :meth:`exception` はタイムアウト引数を取らず、フュー"
"チャがまだ終了していないとき例外を送出します。"
#: ../../library/asyncio-task.rst:218
msgid ""
"Callbacks registered with :meth:`add_done_callback` are always called via "
"the event loop's :meth:`~AbstractEventLoop.call_soon`."
msgstr ""
#: ../../library/asyncio-task.rst:221
msgid ""
"This class is not compatible with the :func:`~concurrent.futures.wait` and :"
"func:`~concurrent.futures.as_completed` functions in the :mod:`concurrent."
"futures` package."
msgstr ""
"このクラスは :mod:`concurrent.futures` パッケージの :func:`~concurrent."
"futures.wait` および :func:`~concurrent.futures.as_completed` 関数との互換性"
"はありません。"
#: ../../library/asyncio-task.rst:225 ../../library/asyncio-task.rst:392
msgid "This class is :ref:`not thread safe <asyncio-multithreading>`."
msgstr ""
"このクラスは :ref:`スレッド安全ではありません <asyncio-multithreading>`。"
#: ../../library/asyncio-task.rst:229
msgid "Cancel the future and schedule callbacks."
msgstr "フューチャとスケジュールされたコールバックをキャンセルします。"
#: ../../library/asyncio-task.rst:231
msgid ""
"If the future is already done or cancelled, return ``False``. Otherwise, "
"change the future's state to cancelled, schedule the callbacks and return "
"``True``."
msgstr ""
"フューチャがすでに終了しているかキャンセルされていた場合 ``False`` を返し、そ"
"うでない場合フューチャの状態をキャンセルに変更し、コールバックをスケジュール"
"し、``True`` を返します。"
#: ../../library/asyncio-task.rst:237
msgid "Return ``True`` if the future was cancelled."
msgstr "フューチャがキャンセルされていた場合 ``True`` を返します。"
#: ../../library/asyncio-task.rst:241
msgid "Return ``True`` if the future is done."
msgstr ""
#: ../../library/asyncio-task.rst:243
msgid ""
"Done means either that a result / exception are available, or that the "
"future was cancelled."
msgstr ""
"終了とは、結果が返された、例外が送出された、あるいはフューチャがキャンセルさ"
"れたことを意味します。"
#: ../../library/asyncio-task.rst:248
msgid "Return the result this future represents."
msgstr "このフューチャが表す結果を返します。"
#: ../../library/asyncio-task.rst:250
msgid ""
"If the future has been cancelled, raises :exc:`CancelledError`. If the "
"future's result isn't yet available, raises :exc:`InvalidStateError`. If the "
"future is done and has an exception set, this exception is raised."
msgstr ""
"フューチャがキャンセルされていた場合 :exc:`CancelledError` が送出されます。"
"フューチャの結果がまだ利用できない場合 :exc:`InvalidStateError` が送出されま"
"す。フューチャが終了し例外の集合を持っていた場合その例外が送出されます。"
#: ../../library/asyncio-task.rst:256
msgid "Return the exception that was set on this future."
msgstr "このフューチャで設定された例外を返します。"
#: ../../library/asyncio-task.rst:258
msgid ""
"The exception (or ``None`` if no exception was set) is returned only if the "
"future is done. If the future has been cancelled, raises :exc:"
"`CancelledError`. If the future isn't done yet, raises :exc:"
"`InvalidStateError`."
msgstr ""
"例外 (例外が設定されていない場合は ``None``) はフューチャが終了した場合のみ返"
"されます。フューチャがキャンセルされていた場合 :exc:`CancelledError` が送出さ"
"れます。フューチャがまだ終了していない場合 :exc:`InvalidStateError` が送出さ"
"れます。"
#: ../../library/asyncio-task.rst:265
msgid "Add a callback to be run when the future becomes done."
msgstr "フューチャが終了したときに実行するコールバックを追加します。"
#: ../../library/asyncio-task.rst:267
msgid ""
"The callback is called with a single argument - the future object. If the "
"future is already done when this is called, the callback is scheduled with :"
"meth:`~AbstractEventLoop.call_soon`."
msgstr ""
#: ../../library/asyncio-task.rst:271
msgid ""
":ref:`Use functools.partial to pass parameters to the callback <asyncio-pass-"
"keywords>`. For example, ``fut.add_done_callback(functools.partial(print, "
"\"Future:\", flush=True))`` will call ``print(\"Future:\", fut, "
"flush=True)``."
msgstr ""
":ref:`引数をコールバックに渡すには functools.partial を使います <asyncio-"
"pass-keywords>`。例えば ``fut.add_done_callback(functools.partial(print, "
"\"Future:\", flush=True))`` は ``print(\"Future:\", fut, flush=True)`` を呼び"
"ます。"
#: ../../library/asyncio-task.rst:278
msgid "Remove all instances of a callback from the \"call when done\" list."
msgstr ""
"\"終了時に呼び出す\" リストからコールバックのすべてのインスタンスを除去しま"
"す。"
#: ../../library/asyncio-task.rst:280
msgid "Returns the number of callbacks removed."
msgstr "除去されたコールバック数を返します。"
#: ../../library/asyncio-task.rst:284
msgid "Mark the future done and set its result."
msgstr "フューチャの終了をマークしその結果を設定します。"
#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:293
msgid ""
"If the future is already done when this method is called, raises :exc:"
"`InvalidStateError`."
msgstr ""
"このメソッドが呼ばれたときにフューチャがすでに終了している場合、:exc:"
"`InvalidStateError` を送出します。"
#: ../../library/asyncio-task.rst:291
msgid "Mark the future done and set an exception."
msgstr "フューチャの終了をマークし例外を設定します。"
#: ../../library/asyncio-task.rst:298
msgid "Example: Future with run_until_complete()"
msgstr "例: run_until_complete() を使ったフューチャ"
#: ../../library/asyncio-task.rst:300
msgid ""
"Example combining a :class:`Future` and a :ref:`coroutine function "
"<coroutine>`::"
msgstr ""
":class:`Future` と :ref:`コルーチン関数 <coroutine>` を組み合わせた例::"
#: ../../library/asyncio-task.rst:316
msgid ""
"The coroutine function is responsible for the computation (which takes 1 "
"second) and it stores the result into the future. The :meth:"
"`~AbstractEventLoop.run_until_complete` method waits for the completion of "
"the future."
msgstr ""
#: ../../library/asyncio-task.rst:322
msgid ""
"The :meth:`~AbstractEventLoop.run_until_complete` method uses internally "
"the :meth:`~Future.add_done_callback` method to be notified when the future "
"is done."
msgstr ""
#: ../../library/asyncio-task.rst:328
msgid "Example: Future with run_forever()"
msgstr "例: run_forever() を使ったフューチャ"
#: ../../library/asyncio-task.rst:330
msgid ""
"The previous example can be written differently using the :meth:`Future."
"add_done_callback` method to describe explicitly the control flow::"
msgstr ""
"上の例を :meth:`Future.add_done_callback` メソッド使って制御フローを明示して"
"書くこともできます::"
#: ../../library/asyncio-task.rst:353
msgid ""
"In this example, the future is used to link ``slow_operation()`` to "
"``got_result()``: when ``slow_operation()`` is done, ``got_result()`` is "
"called with the result."
msgstr ""
"この例では ``slow_operation()`` を ``got_result()`` にリンクするために "
"future を用いています。``slow_operation()`` が終了したとき ``got_result()`` "
"が結果と供に呼ばれます。"
#: ../../library/asyncio-task.rst:359
msgid "Task"
msgstr "タスク"
#: ../../library/asyncio-task.rst:363
msgid ""
"Schedule the execution of a :ref:`coroutine <coroutine>`: wrap it in a "
"future. A task is a subclass of :class:`Future`."
msgstr ""
":ref:`コルーチン <coroutine>` の実行をスケジュールします: それをフューチャ内"
"にラップします。タスクは :class:`Future` のサブクラスです。"
#: ../../library/asyncio-task.rst:366
msgid ""
"A task is responsible for executing a coroutine object in an event loop. If "
"the wrapped coroutine yields from a future, the task suspends the execution "
"of the wrapped coroutine and waits for the completion of the future. When "
"the future is done, the execution of the wrapped coroutine restarts with the "
"result or the exception of the future."
msgstr ""
#: ../../library/asyncio-task.rst:372
msgid ""
"Event loops use cooperative scheduling: an event loop only runs one task at "
"a time. Other tasks may run in parallel if other event loops are running in "
"different threads. While a task waits for the completion of a future, the "
"event loop executes a new task."
msgstr ""
"イベントループは協調スケジューリングを使用します: 1 つのイベントループは同時"
"に 1 つのタスクのみ実行します。その他のタスクは、他のイベントループが異なるメ"
"ソッドで実行されている場合に並列で実行されるかもしれません。タスクがフュー"
"チャの計算を待っている間、イベントループは新しいタスクを実行します。"
#: ../../library/asyncio-task.rst:377
msgid ""
"The cancellation of a task is different from the cancelation of a future. "
"Calling :meth:`cancel` will throw a :exc:`~concurrent.futures."
"CancelledError` to the wrapped coroutine. :meth:`~Future.cancelled` only "
"returns ``True`` if the wrapped coroutine did not catch the :exc:"
"`~concurrent.futures.CancelledError` exception, or raised a :exc:"
"`~concurrent.futures.CancelledError` exception."
msgstr ""
"タスクのキャンセルはフューチャのキャンセルとは異なります。:meth:`cancel` は"
"ラップされたコルーチンに :exc:`~concurrent.futures.CancelledError` を送出しま"
"す。ラップされたコルーチンが :exc:`~concurrent.futures.CancelledError` 例外を"
"補足しなかった、あるいは :exc:`~concurrent.futures.CancelledError` 例外を送出"
"しなかった場合、:meth:`~Future.cancelled` は常に ``True`` を返します。"
#: ../../library/asyncio-task.rst:385
msgid ""
"If a pending task is destroyed, the execution of its wrapped :ref:`coroutine "
"<coroutine>` did not complete. It is probably a bug and a warning is logged: "
"see :ref:`Pending task destroyed <asyncio-pending-task-destroyed>`."
msgstr ""
"未完のタスクが破棄された場合、それのラップされた :ref:`コルーチン "
"<coroutine>` は完了しません。これはおそらくバグであり警告がログに記録されま"
"す: :ref:`未完のタスクの破棄 <asyncio-pending-task-destroyed>` を参照してくだ"
"さい。"
#: ../../library/asyncio-task.rst:389
msgid ""
"Don't directly create :class:`Task` instances: use the :func:`ensure_future` "
"function or the :meth:`AbstractEventLoop.create_task` method."
msgstr ""
#: ../../library/asyncio-task.rst:396
msgid "Return a set of all tasks for an event loop."
msgstr "イベントループ *loop* のすべてのタスクの集合を返します。"
#: ../../library/asyncio-task.rst:398
msgid "By default all tasks for the current event loop are returned."
msgstr "デフォルトでは現在のイベントループの全タスクが返されます。"
#: ../../library/asyncio-task.rst:402
msgid "Return the currently running task in an event loop or ``None``."
msgstr "イベントループ内で現在実行中のタスクまたは ``None`` を返します。"
#: ../../library/asyncio-task.rst:404
msgid "By default the current task for the current event loop is returned."
msgstr "デフォルトでは現在のイベントループの現在のタスクが返されます。"
#: ../../library/asyncio-task.rst:406
msgid "``None`` is returned when called not in the context of a :class:`Task`."
msgstr ""
":class:`Task` のコンテキスト内から呼び出されたのではない場合 ``None`` が返さ"
"れます。"
#: ../../library/asyncio-task.rst:410
msgid "Request that this task cancel itself."
msgstr "このタスクのキャンセルを自身で要求します。"
#: ../../library/asyncio-task.rst:412
msgid ""
"This arranges for a :exc:`~concurrent.futures.CancelledError` to be thrown "
"into the wrapped coroutine on the next cycle through the event loop. The "
"coroutine then has a chance to clean up or even deny the request using try/"
"except/finally."
msgstr ""
"これは、イベントループを通して次のサイクルにおいてラップされたコルーチンに投"
"入される :exc:`~concurrent.futures.CancelledError` を準備します。コルーチンに"
"はその後 try/except/finally を使用してクリーンアップするか要求を拒否する機会"
"が与えられます。"
#: ../../library/asyncio-task.rst:417
msgid ""
"Unlike :meth:`Future.cancel`, this does not guarantee that the task will be "
"cancelled: the exception might be caught and acted upon, delaying "
"cancellation of the task or preventing cancellation completely. The task may "
"also return a value or raise a different exception."
msgstr ""
":meth:`Future.cancel` と異なり、これはタスクのキャンセルを保証しません: 例外"
"が補足されそれが処理されることで、タスクのキャンセル処理が遅延したりキャンセ"
"ル処理が完了しない場合があります。また、タスクは戻り値を返すか異なる例外を送"
"出する場合もあります。"
#: ../../library/asyncio-task.rst:422
msgid ""
"Immediately after this method is called, :meth:`~Future.cancelled` will not "
"return ``True`` (unless the task was already cancelled). A task will be "
"marked as cancelled when the wrapped coroutine terminates with a :exc:"
"`~concurrent.futures.CancelledError` exception (even if :meth:`cancel` was "
"not called)."
msgstr ""
"このメソッドが呼び出された直後は :meth:`~Future.cancelled` は ``True`` を返し"
"ません (タスクがすでにキャンセル済みの場合は除く)。ラップされたコルーチンが :"
"exc:`~concurrent.futures.CancelledError` で中止されたとき、タスクは (:meth:"
"`cancel` が呼ばれなかった場合でも) キャンセル済みとマークされます。"
#: ../../library/asyncio-task.rst:430
msgid "Return the list of stack frames for this task's coroutine."
msgstr "このタスクのコルーチンのスタックフレームのリストを返します。"
#: ../../library/asyncio-task.rst:432
msgid ""
"If the coroutine is not done, this returns the stack where it is suspended. "
"If the coroutine has completed successfully or was cancelled, this returns "
"an empty list. If the coroutine was terminated by an exception, this "
"returns the list of traceback frames."
msgstr ""
#: ../../library/asyncio-task.rst:438
msgid "The frames are always ordered from oldest to newest."
msgstr "フレームは常に古いものから新しい物へ並んでいます。"
#: ../../library/asyncio-task.rst:440
msgid ""
"The optional limit gives the maximum number of frames to return; by default "
"all available frames are returned. Its meaning differs depending on whether "
"a stack or a traceback is returned: the newest frames of a stack are "
"returned, but the oldest frames of a traceback are returned. (This matches "
"the behavior of the traceback module.)"
msgstr ""
"任意の引数 *limit* には返すフレームの最大数を指定します; デフォルトでは有効な"
"すべてのフレームが返されます。これは返される値がスタックかトレースバックかに"
"よって意味が変わります: スタックでは最新のフレームから返されますが、トレース"
"バックでは最古のものから返されます。 (これは traceback モジュールの振る舞いと"
"一致します。)"
#: ../../library/asyncio-task.rst:446
msgid ""
"For reasons beyond our control, only one stack frame is returned for a "
"suspended coroutine."
msgstr ""
"いかんともしがたい理由により、サスペンドされているコルーチンの場合スタックフ"
"レームが 1 個だけ返されます。"
#: ../../library/asyncio-task.rst:451
msgid "Print the stack or traceback for this task's coroutine."
msgstr "このタスクのコルーチンのスタックあるいはトレースバックを出力します。"
#: ../../library/asyncio-task.rst:453
msgid ""
"This produces output similar to that of the traceback module, for the frames "
"retrieved by get_stack(). The limit argument is passed to get_stack(). The "
"file argument is an I/O stream to which the output is written; by default "
"output is written to sys.stderr."
msgstr ""
"この出力は get_stack() によって回収されたフレームで、traceback モジュールのそ"
"れと同じです。引数 *limit* は get_stack() に渡されます。引数 *file* は出力を"
"書き込む I/O ストリームです; デフォルトでは ``sys.stderr`` になります。"
#: ../../library/asyncio-task.rst:460
msgid "Example: Parallel execution of tasks"
msgstr "例: タスクの並列実行"
#: ../../library/asyncio-task.rst:462
msgid "Example executing 3 tasks (A, B, C) in parallel::"
msgstr "3 個のタスク (A, B, C) を並列に実行する例です::"
#: ../../library/asyncio-task.rst:482
msgid "Output::"
msgstr "出力::"
#: ../../library/asyncio-task.rst:494
msgid ""
"A task is automatically scheduled for execution when it is created. The "
"event loop stops when all tasks are done."
msgstr ""
"タスクは作成されたときに実行を自動的にスケジュールされます。イベントループは"
"すべてのタスクが終了したときに停止します。"
#: ../../library/asyncio-task.rst:499
msgid "Task functions"
msgstr "タスク関数"
#: ../../library/asyncio-task.rst:503
msgid ""
"In the functions below, the optional *loop* argument allows explicitly "
"setting the event loop object used by the underlying task or coroutine. If "
"it's not provided, the default event loop is used."
msgstr ""
#: ../../library/asyncio-task.rst:509
msgid ""
"Return an iterator whose values, when waited for, are :class:`Future` "
"instances."
msgstr ""
"その値のイテレーターか、待機中のときは :class:`Future` インスタンスを返しま"
"す。"
#: ../../library/asyncio-task.rst:512
msgid ""
"Raises :exc:`asyncio.TimeoutError` if the timeout occurs before all Futures "
"are done."
msgstr ""
"全フューチャが終了する前にタイムアウトが発生した場合 :exc:`asyncio."
"TimeoutError` を送出します。"
#: ../../library/asyncio-task.rst:515
msgid "Example::"
msgstr "以下はプログラム例です::"
#: ../../library/asyncio-task.rst:523
msgid "The futures ``f`` are not necessarily members of fs."
msgstr "フューチャ ``f`` は fs のメンバーである必要はありません。"
#: ../../library/asyncio-task.rst:527
msgid ""
"Schedule the execution of a :ref:`coroutine object <coroutine>`: wrap it in "
"a future. Return a :class:`Task` object."
msgstr ""
":ref:`コルーチンオブジェクト <coroutine>` の実行をスケジュールします: このと"
"きフューチャにラップします。:class:`Task` オブジェクトを返します。"
#: ../../library/asyncio-task.rst:530
msgid "If the argument is a :class:`Future`, it is returned directly."
msgstr "引数が :class:`Future` の場合、それが直接返されます。"
#: ../../library/asyncio-task.rst:534
msgid "The function accepts any :term:`awaitable` object."
msgstr ""
"この関数はどんな :term:`awaitable` なオブジェクトでも受け入れるようになりまし"
"た。"
#: ../../library/asyncio-task.rst:539
msgid "The :meth:`AbstractEventLoop.create_task` method."
msgstr ""
#: ../../library/asyncio-task.rst:543
msgid "A deprecated alias to :func:`ensure_future`."
msgstr ":func:`ensure_future` への非推奨なエイリアスです。"
#: ../../library/asyncio-task.rst:549
msgid ""
"Wrap a :class:`concurrent.futures.Future` object in a :class:`Future` object."
msgstr ""
#: ../../library/asyncio-task.rst:554
msgid ""
"Return a future aggregating results from the given coroutine objects or "
"futures."
msgstr ""
"与えられたコルーチンオブジェクトあるいはフューチャからの結果を一つにまとめた"
"フューチャを返します。"
#: ../../library/asyncio-task.rst:557
msgid ""
"All futures must share the same event loop. If all the tasks are done "
"successfully, the returned future's result is the list of results (in the "
"order of the original sequence, not necessarily the order of results "
"arrival). If *return_exceptions* is true, exceptions in the tasks are "
"treated the same as successful results, and gathered in the result list; "
"otherwise, the first raised exception will be immediately propagated to the "
"returned future."
msgstr ""
#: ../../library/asyncio-task.rst:565
msgid ""
"Cancellation: if the outer Future is cancelled, all children (that have not "
"completed yet) are also cancelled. If any child is cancelled, this is "
"treated as if it raised :exc:`~concurrent.futures.CancelledError` -- the "
"outer Future is *not* cancelled in this case. (This is to prevent the "
"cancellation of one child to cause other children to be cancelled.)"
msgstr ""
"キャンセル: 外側のフューチャがキャンセルされた場合、すべての (まだ完了してい"
"ない) 子プロセスもキャンセルされます。いずれかの子プロセスがキャンセルされた"
"場合、これは :exc:`~concurrent.futures.CancelledError` を送出するように扱いま"
"す -- この場合外側のフューチャはキャンセル *されません*。 (This is to "
"prevent the cancellation of one child to cause other children to be "
"cancelled.)"
#: ../../library/asyncio-task.rst:571
msgid ""
"If the *gather* itself is cancelled, the cancellation is propagated "
"regardless of *return_exceptions*."
msgstr ""
"*gather* 自身がキャンセルされた場合は、 *return_exceptions* の値に関わらず"
"キャンセルが伝搬されます。"
#: ../../library/asyncio-task.rst:577
msgid ""
"Return ``True`` if *obj* is a :ref:`coroutine object <coroutine>`, which may "
"be based on a generator or an :keyword:`async def` coroutine."
msgstr ""
#: ../../library/asyncio-task.rst:582
msgid ""
"Return ``True`` if *func* is determined to be a :ref:`coroutine function "
"<coroutine>`, which may be a decorated generator function or an :keyword:"
"`async def` function."
msgstr ""
#: ../../library/asyncio-task.rst:588
msgid "Submit a :ref:`coroutine object <coroutine>` to a given event loop."
msgstr ""
#: ../../library/asyncio-task.rst:590
msgid "Return a :class:`concurrent.futures.Future` to access the result."
msgstr ""
#: ../../library/asyncio-task.rst:592
msgid ""
"This function is meant to be called from a different thread than the one "
"where the event loop is running. Usage::"
msgstr ""
#: ../../library/asyncio-task.rst:602
msgid ""
"If an exception is raised in the coroutine, the returned future will be "
"notified. It can also be used to cancel the task in the event loop::"
msgstr ""
#: ../../library/asyncio-task.rst:615
msgid ""
"See the :ref:`concurrency and multithreading <asyncio-multithreading>` "
"section of the documentation."
msgstr ""
"このドキュメントの :ref:`asyncio-multithreading` 節を参照してください。"
#: ../../library/asyncio-task.rst:620
msgid ""
"Unlike other functions from the module, :func:`run_coroutine_threadsafe` "
"requires the *loop* argument to be passed explicitly."
msgstr ""
#: ../../library/asyncio-task.rst:628
msgid ""
"Create a :ref:`coroutine <coroutine>` that completes after a given time (in "
"seconds). If *result* is provided, it is produced to the caller when the "
"coroutine completes."
msgstr ""
"与えられた時間 (秒) 後に完了する :ref:`コルーチン <coroutine>` を作成します。"
"*result* が与えられた場合、コルーチン完了時にそれが呼び出し元に返されます。"
#: ../../library/asyncio-task.rst:632
msgid ""
"The resolution of the sleep depends on the :ref:`granularity of the event "
"loop <asyncio-delayed-calls>`."
msgstr ""
"スリープの分解能は :ref:`イベントループの粒度 <asyncio-delayed-calls>` に依存"
"します。"
#: ../../library/asyncio-task.rst:635 ../../library/asyncio-task.rst:699
msgid "This function is a :ref:`coroutine <coroutine>`."
msgstr "この関数は :ref:`コルーチン <coroutine>` です。"
#: ../../library/asyncio-task.rst:639
msgid "Wait for a future, shielding it from cancellation."
msgstr "フューチャを待機しキャンセル処理から保護します。"
#: ../../library/asyncio-task.rst:641
msgid "The statement::"
msgstr "命令文::"
#: ../../library/asyncio-task.rst:645
msgid "is exactly equivalent to the statement::"
msgstr "上の文は以下と完全に等価です::"
#: ../../library/asyncio-task.rst:649
msgid ""
"*except* that if the coroutine containing it is cancelled, the task running "
"in ``something()`` is not cancelled. From the point of view of "
"``something()``, the cancellation did not happen. But its caller is still "
"cancelled, so the yield-from expression still raises :exc:`~concurrent."
"futures.CancelledError`. Note: If ``something()`` is cancelled by other "
"means this will still cancel ``shield()``."
msgstr ""
"それを含むコルーチンがキャンセルされた場合を *除き*、``something()`` 内で動作"
"するタスクはキャンセルされません。``something()`` 側から見るとキャンセル処理"
"は発生しません。ただし、呼び出し元がキャンセルされた場合は、yield-from 表現"
"は :exc:`~concurrent.futures.CancelledError` を送出します。注意: "
"``something()`` が他の理由でキャンセルされた場合は ``shield()`` でも保護でき"
"ません。"
#: ../../library/asyncio-task.rst:656
msgid ""
"If you want to completely ignore cancellation (not recommended) you can "
"combine ``shield()`` with a try/except clause, as follows::"
msgstr ""
"完全にキャンセル処理を無視させたい場合 (推奨はしません) は、以下のように "
"``shield()`` と try/except 節の組み合わせで行うことができます::"
#: ../../library/asyncio-task.rst:668
msgid ""
"Wait for the Futures and coroutine objects given by the sequence *futures* "
"to complete. Coroutines will be wrapped in Tasks. Returns two sets of :"
"class:`Future`: (done, pending)."
msgstr ""
"シーケンス *futures* で与えられたフューチャおよびコルーチンオブジェクトが完了"
"するまで待機します。コルーチンはタスクでラップされます。戻り値は (完了した :"
"class:`Future`, 未完の :class:`Future`) の 2 個の集合になります。"
#: ../../library/asyncio-task.rst:672
msgid "The sequence *futures* must not be empty."
msgstr "シーケンス *futures* は空であってはなりません。"
#: ../../library/asyncio-task.rst:674
msgid ""
"*timeout* can be used to control the maximum number of seconds to wait "
"before returning. *timeout* can be an int or float. If *timeout* is not "
"specified or ``None``, there is no limit to the wait time."
msgstr ""
"*timeout* で結果を返すまで待機する最大秒数を指定できます。*timeout* は整数か"
"浮動小数点数をとります。*timeout* が指定されないか ``None`` の場合、無期限に"
"待機します。"
#: ../../library/asyncio-task.rst:678
msgid ""
"*return_when* indicates when this function should return. It must be one of "
"the following constants of the :mod:`concurrent.futures` module:"
msgstr ""
"*return_when* でこの関数がいつ結果を返すか指定します。指定できる値は以下の :"
"mod:`concurrent.futures` モジュール定数のどれか一つです:"
#: ../../library/asyncio-task.rst:684
msgid "Constant"
msgstr "定数"
#: ../../library/asyncio-task.rst:684
msgid "Description"
msgstr "説明"
#: ../../library/asyncio-task.rst:686
msgid ":const:`FIRST_COMPLETED`"
msgstr ":const:`FIRST_COMPLETED`"
#: ../../library/asyncio-task.rst:686
msgid "The function will return when any future finishes or is cancelled."
msgstr "いずれかのフューチャが終了したかキャンセルされたときに返します。"
#: ../../library/asyncio-task.rst:689
msgid ":const:`FIRST_EXCEPTION`"
msgstr ":const:`FIRST_EXCEPTION`"
#: ../../library/asyncio-task.rst:689
msgid ""
"The function will return when any future finishes by raising an exception. "
"If no future raises an exception then it is equivalent to :const:"
"`ALL_COMPLETED`."
msgstr ""
"いずれかのフューチャが例外の送出で終了した場合に返します。例外を送出した"
"フューチャがない場合は、:const:`ALL_COMPLETED` と等価になります。"
#: ../../library/asyncio-task.rst:695
msgid ":const:`ALL_COMPLETED`"
msgstr ":const:`ALL_COMPLETED`"
#: ../../library/asyncio-task.rst:695
msgid "The function will return when all futures finish or are cancelled."
msgstr "すべてのフューチャが終了したかキャンセルされたときに返します。"
#: ../../library/asyncio-task.rst:701
msgid "Usage::"
msgstr "使い方::"
#: ../../library/asyncio-task.rst:707
msgid ""
"This does not raise :exc:`asyncio.TimeoutError`! Futures that aren't done "
"when the timeout occurs are returned in the second set."
msgstr ""
"これは :exc:`asyncio.TimeoutError` を送出しません。タイムアウトが発生して完了"
"しなかったフューチャは戻り値の後者の集合に含まれます。"
#: ../../library/asyncio-task.rst:713
msgid ""
"Wait for the single :class:`Future` or :ref:`coroutine object <coroutine>` "
"to complete with timeout. If *timeout* is ``None``, block until the future "
"completes."
msgstr ""
"単一の :class:`Future` または :ref:`コルーチンオブジェクト <coroutine>` を期"
"限付きで待機します。*timeout* が ``None`` の場合、フューチャが完了するまでブ"
"ロックします。"
#: ../../library/asyncio-task.rst:717
msgid "Coroutine will be wrapped in :class:`Task`."
msgstr "コルーチンは :class:`Task` でラップされます。"
#: ../../library/asyncio-task.rst:719
msgid ""
"Returns result of the Future or coroutine. When a timeout occurs, it "
"cancels the task and raises :exc:`asyncio.TimeoutError`. To avoid the task "
"cancellation, wrap it in :func:`shield`."
msgstr ""
"フューチャあるいはコルーチンの結果を返します。タイムアウトが発生した場合、タ"
"スクをキャンセルし :exc:`asyncio.TimeoutError` を送出します。タスクのキャンセ"
"ルを抑止したい場合は :func:`shield` でラップしてください。"
#: ../../library/asyncio-task.rst:723
msgid "If the wait is cancelled, the future *fut* is also cancelled."
msgstr "待機が中止された場合 *fut* も中止されます。"
#: ../../library/asyncio-task.rst:725
msgid "This function is a :ref:`coroutine <coroutine>`, usage::"
msgstr "この関数は :ref:`コルーチン <coroutine>` です。使用法::"
#: ../../library/asyncio-task.rst:729
msgid "If the wait is cancelled, the future *fut* is now also cancelled."
msgstr "待機が中止された場合 *fut* も中止されます。"