-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathasyncio-eventloop.po
More file actions
1645 lines (1219 loc) · 146 KB
/
Copy pathasyncio-eventloop.po
File metadata and controls
1645 lines (1219 loc) · 146 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
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Alireza Shabani (Revisto) <theRevisto@gmail.com>, 2025
# Danial Behzadi <dani.behzi@ubuntu.com>, 2025
# Rafael Fontenelle <rffontenelle@gmail.com>, 2025
# Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-16 12:56+0000\n"
"PO-Revision-Date: 2026-09-12 16:50+0330\n"
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
"Language-Team: Persian (https://github.com/python/python-docs-fa/)\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.6\n"
msgid "Event loop"
msgstr "حلقه رویداد"
msgid "**Source code:** :source:`Lib/asyncio/events.py`, :source:`Lib/asyncio/base_events.py`"
msgstr "**کد منبع:** :source:`Lib/asyncio/events.py`, :source:`Lib/asyncio/base_events.py`"
msgid "Preface"
msgstr "پیشگفتار"
msgid "The event loop is the core of every asyncio application. Event loops run asynchronous tasks and callbacks, perform network IO operations, and run subprocesses."
msgstr "حلقهی رویداد، هستهی هر برنامهی asyncio است. حلقههای رویداد، وظایف ناهمگام و کالبکها را اجرا میکنند، عملیات ورودی/خروجی شبکه را انجام میدهند و زیرفرایندها را اجرا میکنند."
msgid "Application developers should typically use the high-level asyncio functions, such as :func:`asyncio.run`, and should rarely need to reference the loop object or call its methods. This section is intended mostly for authors of lower-level code, libraries, and frameworks, who need finer control over the event loop behavior."
msgstr "توسعهدهندگان برنامه باید معمولاً از توابع سطح بالای asyncio، مانند :func:`asyncio.run`، استفاده کنند و بهندرت نیاز است که به شیء حلقه ارجاع دهند یا متدهای آن را فراخوانی کنند. این بخش عمدتاً برای نویسندگان کد، کتابخانهها و چارچوبهای سطح پایینتر در نظر گرفته شده است که به کنترل دقیقتری بر رفتار حلقه رویداد نیاز دارند."
msgid "Obtaining the Event Loop"
msgstr "به دست آوردن حلقه رویداد"
msgid "The following low-level functions can be used to get, set, or create an event loop:"
msgstr "میتوان از توابع سطح پایین زیر برای دریافت، تنظیم یا ایجاد یک حلقه رویداد استفاده کرد:"
msgid "Return the running event loop in the current OS thread."
msgstr "حلقه رویداد در حال اجرا را در نخ سیستمعامل فعلی برمیگرداند."
msgid "Raise a :exc:`RuntimeError` if there is no running event loop."
msgstr "اگر هیچ حلقه رویدادی در حال اجرا نباشد، یک :exc:`RuntimeError` پرتاب میشود."
msgid "This function can only be called from a coroutine or a callback."
msgstr "این تابع را فقط میتوان از یک همروال یا کالبک فراخوانی کرد."
msgid "Get the current event loop."
msgstr "حلقهی رویداد جاری را دریافت کنید."
msgid "When called from a coroutine or a callback (e.g. scheduled with call_soon or similar API), this function will always return the running event loop."
msgstr "هنگامی که از یک همروال یا کالبک (مثلاً زمانبندیشده با call_soon یا API مشابه) فراخوانی شود، این تابع همیشه حلقه رویداد در حال اجرا را برمیگرداند."
msgid "If there is no running event loop set, the function will return the result of the ``get_event_loop_policy().get_event_loop()`` call."
msgstr "اگر هیچ حلقهی رویداد در حال اجرا تنظیمنشده باشد، تابع نتیجهی فراخوانی ``get_event_loop_policy().get_event_loop()`` را برمیگرداند."
msgid "Because this function has rather complex behavior (especially when custom event loop policies are in use), using the :func:`get_running_loop` function is preferred to :func:`get_event_loop` in coroutines and callbacks."
msgstr "از آنجا که این تابع رفتار نسبتاً پیچیدهای دارد (بهویژه زمانی که از سیاستهای سفارشی حلقه رویداد استفاده میشود)، در همروالها و کالبکها استفاده از تابع :func:`get_running_loop` به :func:`get_event_loop` ترجیح داده میشود."
msgid "As noted above, consider using the higher-level :func:`asyncio.run` function, instead of using these lower level functions to manually create and close an event loop."
msgstr "همانطور که در بالا اشاره شد، بهجای استفاده از این توابع سطح پایین برای ایجاد و بستن دستی حلقه رویداد، استفاده از تابع سطح بالاتر :func:`asyncio.run` را در نظر بگیرید."
msgid "Raises a :exc:`RuntimeError` if there is no current event loop."
msgstr "اگر حلقه رویداد جاری وجود نداشته باشد، یک :exc:`RuntimeError` پرتاب میشود."
msgid "The :mod:`!asyncio` policy system is deprecated and will be removed in Python 3.16; from there on, this function will return the current running event loop if present else it will return the loop set by :func:`set_event_loop`."
msgstr "سیستم سیاستگذاری :mod:`!asyncio` منسوخ شده است و در Python 3.16 حذف خواهد شد؛ از آن پس، این تابع در صورت وجود، حلقه رویداد در حال اجرای فعلی را برمیگرداند، در غیر این صورت حلقه تنظیمشده توسط :func:`set_event_loop` را برمیگرداند."
msgid "Set *loop* as the current event loop for the current OS thread."
msgstr "*loop* را بهعنوان حلقه رویداد جاری برای نخ جاری سیستمعامل تنظیم میکند."
msgid "Create and return a new event loop object."
msgstr "یک شیء حلقه رویداد جدید ایجاد و برمیگرداند."
msgid "Note that the behaviour of :func:`get_event_loop`, :func:`set_event_loop`, and :func:`new_event_loop` functions can be altered by :ref:`setting a custom event loop policy <asyncio-policies>`."
msgstr "توجه داشته باشید که رفتار توابع :func:`get_event_loop`، :func:`set_event_loop` و :func:`new_event_loop` میتواند با :ref:`تنظیم یک سیاست حلقه رویداد سفارشی <asyncio-policies>` تغییر کند."
msgid "Contents"
msgstr "فهرست"
msgid "This documentation page contains the following sections:"
msgstr "این صفحهی مستندات شامل بخشهای زیر است:"
msgid "The `Event Loop Methods`_ section is the reference documentation of the event loop APIs;"
msgstr "بخش `Event Loop Methods`_ مستندات مرجع APIهای حلقه رویداد است؛"
msgid "The `Callback Handles`_ section documents the :class:`Handle` and :class:`TimerHandle` instances which are returned from scheduling methods such as :meth:`loop.call_soon` and :meth:`loop.call_later`;"
msgstr "بخش `Callback Handles`_ نمونههای :class:`Handle` و :class:`TimerHandle` را که از متدهای زمانبندی مانند :meth:`loop.call_soon` و :meth:`loop.call_later` بازگردانده میشوند، توضیح میدهد؛"
msgid "The `Server Objects`_ section documents types returned from event loop methods like :meth:`loop.create_server`;"
msgstr "بخش `Server Objects`_ انواعی را که از متدهای حلقه رویداد مانند :meth:`loop.create_server` بازگشت داده میشوند، توضیح میدهد؛"
msgid "The `Event Loop Implementations`_ section documents the :class:`SelectorEventLoop` and :class:`ProactorEventLoop` classes;"
msgstr "بخش `Event Loop Implementations`_، کلاسهای :class:`SelectorEventLoop` و :class:`ProactorEventLoop` را مستند میکند؛"
msgid "The `Examples`_ section showcases how to work with some event loop APIs."
msgstr "بخش `Examples`_ چگونگی کار با برخی از APIهای حلقه رویداد را نشان میدهد."
msgid "Event loop methods"
msgstr "متدهای حلقه رویداد"
msgid "Event loops have **low-level** APIs for the following:"
msgstr "حلقههای رویداد APIهای **سطح پایین** برای موارد زیر دارند:"
msgid "Running and stopping the loop"
msgstr "اجرا و توقف حلقه"
msgid "Run until the *future* (an instance of :class:`Future`) has completed."
msgstr "تا کامل شدن *future* (نمونهای از :class:`Future`) اجرا کنید."
msgid "If the argument is a :ref:`coroutine object <coroutine>` it is implicitly scheduled to run as a :class:`asyncio.Task`."
msgstr "اگر آرگومان یک :ref:`شیء همروال <coroutine>` باشد، بهطور ضمنی برای اجرا بهعنوان یک :class:`asyncio.Task` زمانبندی میشود."
msgid "Return the Future's result or raise its exception."
msgstr "نتیجهی Future را برمیگرداند یا استثنای آن را پرتاب میکند."
msgid "Run the event loop until :meth:`stop` is called."
msgstr "حلقه رویداد را تا زمانی که :meth:`stop` فراخوانی شود، اجرا کنید."
msgid "If :meth:`stop` is called before :meth:`run_forever` is called, the loop will poll the I/O selector once with a timeout of zero, run all callbacks scheduled in response to I/O events (and those that were already scheduled), and then exit."
msgstr "اگر :meth:`stop` پیش از فراخوانی :meth:`run_forever` فراخوانی شود، حلقه انتخابگر I/O را یک بار با مهلت صفر پایش میکند، تمام کالبکهای برنامهریزیشده در پاسخ به رویدادهای I/O (و آنهایی که از قبل برنامهریزیشده بودند) را اجرا میکند و سپس خارج میشود."
msgid "If :meth:`stop` is called while :meth:`run_forever` is running, the loop will run the current batch of callbacks and then exit. Note that new callbacks scheduled by callbacks will not run in this case; instead, they will run the next time :meth:`run_forever` or :meth:`run_until_complete` is called."
msgstr "اگر :meth:`stop` در حالی که :meth:`run_forever` در حال اجرا است فراخوانی شود، حلقه دسته فعلی کالبکها را اجرا میکند و سپس خارج میشود. توجه داشته باشید که کالبکهای جدیدی که توسط کالبکها زمانبندی شدهاند، در این حالت اجرا نخواهند شد؛ در عوض، آنها بار بعدی که :meth:`run_forever` یا :meth:`run_until_complete` فراخوانی شود، اجرا خواهند شد."
msgid "Stop the event loop."
msgstr "حلقه رویداد را متوقف کنید."
msgid "Return ``True`` if the event loop is currently running."
msgstr "اگر حلقه رویداد هماکنون در حال اجرا باشد، ``True`` را برمیگرداند."
msgid "Return ``True`` if the event loop was closed."
msgstr "اگر حلقه رویداد بسته شده باشد، ``True`` را برمیگرداند."
msgid "Close the event loop."
msgstr "حلقه رویداد را ببندید."
msgid "The loop must not be running when this function is called. Any pending callbacks will be discarded."
msgstr "هنگامی که این تابع فراخوانی میشود، حلقه نباید در حال اجرا باشد. تمام کالبکهای در انتظار دور ریخته میشوند."
msgid "This method clears all queues and shuts down the executor, but does not wait for the executor to finish."
msgstr "این متد همه صفها را پاک میکند و اجراکننده (executor) را خاموش میکند، اما منتظر پایان اجراکننده نمیماند."
msgid "This method is idempotent and irreversible. No other methods should be called after the event loop is closed."
msgstr "این متد همتوان (idempotent) و بازگشتناپذیر است. پس از بسته شدن حلقه رویداد، نباید متدهای دیگری فراخوانی شوند."
msgid "Schedule all currently open :term:`asynchronous generator` objects to close with an :meth:`~agen.aclose` call. After calling this method, the event loop will issue a warning if a new asynchronous generator is iterated. This should be used to reliably finalize all scheduled asynchronous generators."
msgstr "تمام اشیای :term:`asynchronous generator` را که در حال حاضر باز هستند، برای بستهشدن با فراخوانی :meth:`~agen.aclose` زمانبندی میکند. پس از فراخوانی این متد، در صورت پیمایش یک تولیدگر ناهمگام جدید، حلقه رویداد هشداری نشان خواهد داد. باید از این برای نهاییسازی قابلاطمینان تمام تولیدگرهای ناهمگام زمانبندیشده استفاده شود."
msgid "Note that there is no need to call this function when :func:`asyncio.run` is used."
msgstr "توجه داشته باشید که هنگامی که از :func:`asyncio.run` استفاده میشود، نیازی به فراخوانی این تابع نیست."
msgid "Example::"
msgstr "مثال::"
msgid ""
"try:\n"
" loop.run_forever()\n"
"finally:\n"
" loop.run_until_complete(loop.shutdown_asyncgens())\n"
" loop.close()"
msgstr ""
"try:\n"
" loop.run_forever()\n"
"finally:\n"
" loop.run_until_complete(loop.shutdown_asyncgens())\n"
" loop.close()"
msgid "Schedule the closure of the default executor and wait for it to join all of the threads in the :class:`~concurrent.futures.ThreadPoolExecutor`. Once this method has been called, using the default executor with :meth:`loop.run_in_executor` will raise a :exc:`RuntimeError`."
msgstr "بستن اجراکنندهی پیشفرض را زمانبندی میکند و منتظر میماند تا همهی نخهای موجود در :class:`~concurrent.futures.ThreadPoolExecutor` join شوند. پس از فراخوانی این متد، استفاده از اجراکنندهی پیشفرض با :meth:`loop.run_in_executor` باعث پرتاب یک :exc:`RuntimeError` خواهد شد."
msgid "The *timeout* parameter specifies the amount of time (in :class:`float` seconds) the executor will be given to finish joining. With the default, ``None``, the executor is allowed an unlimited amount of time."
msgstr "پارامتر *timeout* مدت زمانی را مشخص میکند (بر حسب ثانیه از نوع :class:`float`) که به اجراکننده (executor) برای اتمام پیوستن (joining) داده میشود. با مقدار پیشفرض ``None``، به اجراکننده زمان نامحدودی داده میشود."
msgid "If the *timeout* is reached, a :exc:`RuntimeWarning` is emitted and the default executor is terminated without waiting for its threads to finish joining."
msgstr "در صورت رسیدن به *timeout*، یک :exc:`RuntimeWarning` نشان داده میشود و اجراکننده پیشفرض بدون انتظار برای اتمام پیوستن (joining) نخهای آن خاتمه داده میشود."
msgid "Do not call this method when using :func:`asyncio.run`, as the latter handles default executor shutdown automatically."
msgstr "هنگام استفاده از :func:`asyncio.run`، این متد را فراخوانی نکنید، زیرا این تابع خاموش کردن اجراکننده (executor) پیشفرض را بهصورت خودکار مدیریت میکند."
msgid "Added the *timeout* parameter."
msgstr "پارامتر *timeout* افزوده شد."
msgid "Scheduling callbacks"
msgstr "زمانبندی کالبکها"
msgid "Schedule the *callback* :term:`callback` to be called with *args* arguments at the next iteration of the event loop."
msgstr "*callback* :term:`کالبک <callback>` را زمانبندی کنید تا در تکرار بعدی حلقه رویداد با آرگومانهای *args* فراخوانی شود."
msgid "Return an instance of :class:`asyncio.Handle`, which can be used later to cancel the callback."
msgstr "یک نمونه از :class:`asyncio.Handle` برمیگرداند، که بعداً میتوان از آن برای لغو کالبک استفاده کرد."
msgid "Callbacks are called in the order in which they are registered. Each callback will be called exactly once."
msgstr "کالبکها به همان ترتیبی که ثبت شدهاند فراخوانی میشوند. هر کالبک دقیقاً یک بار فراخوانی خواهد شد."
msgid "The optional keyword-only *context* argument specifies a custom :class:`contextvars.Context` for the *callback* to run in. Callbacks use the current context when no *context* is provided."
msgstr "آرگومان *context* که اختیاری و فقط کلیدواژهای است، یک :class:`contextvars.Context` سفارشی را مشخص میکند تا *callback* در آن اجرا شود. در صورتی که *context* ارائه نشود، کالبکها از زمینهی جاری استفاده میکنند."
msgid "Unlike :meth:`call_soon_threadsafe`, this method is not thread-safe."
msgstr "برخلاف :meth:`call_soon_threadsafe`، این متد ایمن از نظر نخ نیست."
msgid "A thread-safe variant of :meth:`call_soon`. When scheduling callbacks from another thread, this function *must* be used, since :meth:`call_soon` is not thread-safe."
msgstr "یک گونهی نخایمن از :meth:`call_soon`. هنگام زمانبندی کالبکها از یک نخ دیگر، این تابع *باید* استفاده شود، زیرا :meth:`call_soon` نخایمن نیست."
msgid "This function is safe to be called from a reentrant context or signal handler, however, it is not safe or fruitful to use the returned handle in such contexts."
msgstr "فراخوانی این تابع از یک زمینهی بازورودپذیر (reentrant context) یا مدیر سیگنال ایمن است؛ با این حال، استفاده از دستهی برگرداندهشده در چنین زمینههایی ایمن یا مفید نیست."
msgid "Raises :exc:`RuntimeError` if called on a loop that's been closed. This can happen on a secondary thread when the main application is shutting down."
msgstr "اگر روی حلقهای که بسته شده است فراخوانی شود، :exc:`RuntimeError` پرتاب میشود. این اتفاق ممکن است در یک نخ ثانویه هنگامی که برنامه اصلی در حال خاموش شدن است رخ دهد."
msgid "See the :ref:`concurrency and multithreading <asyncio-multithreading>` section of the documentation."
msgstr "بخش :ref:`همروندی و چندنخی <asyncio-multithreading>` مستندات را ببینید."
msgid "The *context* keyword-only parameter was added. See :pep:`567` for more details."
msgstr "پارامتر فقط کلیدواژهای *context* اضافه شد. برای جزئیات بیشتر :pep:`567` را ببینید."
msgid "Most :mod:`asyncio` scheduling functions don't allow passing keyword arguments. To do that, use :func:`functools.partial`::"
msgstr "بیشتر توابع زمانبندی :mod:`asyncio` اجازهی ارسال آرگومانهای کلیدواژهای را نمیدهند. برای این کار، از :func:`functools.partial` استفاده کنید::"
msgid ""
"# will schedule \"print(\"Hello\", flush=True)\"\n"
"loop.call_soon(\n"
" functools.partial(print, \"Hello\", flush=True))"
msgstr ""
"# will schedule \"print(\"Hello\", flush=True)\"\n"
"loop.call_soon(\n"
" functools.partial(print, \"Hello\", flush=True))"
msgid "Using partial objects is usually more convenient than using lambdas, as asyncio can render partial objects better in debug and error messages."
msgstr "استفاده از اشیاء partial معمولاً راحتتر از استفاده از لامبداها است، زیرا asyncio میتواند اشیاء partial را بهتر در پیامهای اشکالزدایی و خطا نمایش دهد."
msgid "Scheduling delayed callbacks"
msgstr "زمانبندی کالبکهای تأخیری"
msgid "Event loop provides mechanisms to schedule callback functions to be called at some point in the future. Event loop uses monotonic clocks to track time."
msgstr "حلقه رویداد سازوکارهایی را برای زمانبندی توابع کالبک فراهم میکند تا در زمانی در آینده فراخوانی شوند. حلقه رویداد از ساعتهای یکنواخت برای پیگیری زمان استفاده میکند."
msgid "Schedule *callback* to be called after the given *delay* number of seconds (can be either an int or a float)."
msgstr "فراخوانی *callback* را پس از *delay* ثانیه زمانبندی میکند (این مقدار میتواند عدد صحیح یا اعشاری باشد)."
msgid "An instance of :class:`asyncio.TimerHandle` is returned which can be used to cancel the callback."
msgstr "یک نمونه از :class:`asyncio.TimerHandle` بازگردانده میشود که میتوان از آن برای لغو کالبک استفاده کرد."
msgid "*callback* will be called exactly once. If two callbacks are scheduled for exactly the same time, the order in which they are called is undefined."
msgstr "*کالبک* دقیقاً یک بار فراخوانی میشود. اگر دو کالبک برای زمان دقیقاً یکسانی زمانبندی شده باشند، ترتیب فراخوانی آنها تعریفنشده است."
msgid "The optional positional *args* will be passed to the callback when it is called. Use :func:`functools.partial` :ref:`to pass keyword arguments <asyncio-pass-keywords>` to *callback*."
msgstr "آرگومانهای جایگاهی اختیاری *args* هنگام فراخوانی کالبک به آن فرستاده میشوند. برای فرستادن آرگومانهای کلیدواژهای به *callback* از :func:`functools.partial` :ref:`برای فرستادن آرگومانهای کلیدواژهای <asyncio-pass-keywords>` استفاده کنید."
msgid "An optional keyword-only *context* argument allows specifying a custom :class:`contextvars.Context` for the *callback* to run in. The current context is used when no *context* is provided."
msgstr "آرگومان اختیاری فقط کلیدواژهای *context*، امکان تعیین یک :class:`contextvars.Context` سفارشی را فراهم میکند تا *callback* در آن اجرا شود. در صورتی که *context* ارائه نشود، از زمینه فعلی استفاده میشود."
msgid "For performance, callbacks scheduled with :meth:`loop.call_later` may run up to one clock-resolution early (see ``time.get_clock_info('monotonic').resolution``)."
msgstr "برای کارایی، کالبکهای زمانبندیشده با :meth:`loop.call_later` ممکن است تا یک دقت ساعت زودتر اجرا شوند (به ``time.get_clock_info('monotonic').resolution`` مراجعه کنید)."
msgid "In Python 3.7 and earlier with the default event loop implementation, the *delay* could not exceed one day. This has been fixed in Python 3.8."
msgstr "در پایتون 3.7 و نسخههای پیشتر، با پیادهسازی پیشفرض حلقه رویداد، *delay* نمیتوانست بیشتر از یک روز باشد. این مشکل در پایتون 3.8 برطرف شده است."
msgid "Schedule *callback* to be called at the given absolute timestamp *when* (an int or a float), using the same time reference as :meth:`loop.time`."
msgstr "*callback* را زمانبندی کنید تا در برچسب زمانی مطلق دادهشده *when* (یک int یا float) فراخوانی شود، با استفاده از همان مرجع زمانی :meth:`loop.time`."
msgid "This method's behavior is the same as :meth:`call_later`."
msgstr "رفتار این متد همانند :meth:`call_later` است."
msgid "For performance, callbacks scheduled with :meth:`loop.call_at` may run up to one clock-resolution early (see ``time.get_clock_info('monotonic').resolution``)."
msgstr "برای کارایی، ممکن است کالبکهای زمانبندیشده با :meth:`loop.call_at` تا یک تفکیکپذیری ساعت زودتر اجرا شوند (به ``time.get_clock_info('monotonic').resolution`` مراجعه کنید)."
msgid "In Python 3.7 and earlier with the default event loop implementation, the difference between *when* and the current time could not exceed one day. This has been fixed in Python 3.8."
msgstr "در پایتون 3.7 و نسخههای پیشین، در پیادهسازی پیشفرض حلقه رویداد، تفاوت میان *when* و زمان جاری نمیتوانست بیش از یک روز باشد. این مورد در پایتون 3.8 اصلاح شده است."
msgid "Return the current time, as a :class:`float` value, according to the event loop's internal monotonic clock."
msgstr "زمان جاری را بهعنوان یک مقدار :class:`float`، بر اساس ساعت یکنواخت داخلی حلقه رویداد برمیگرداند."
msgid "In Python 3.7 and earlier timeouts (relative *delay* or absolute *when*) should not exceed one day. This has been fixed in Python 3.8."
msgstr "در پایتون 3.7 و نسخههای پیش از آن، مهلتهای زمانی (*delay* نسبی یا *when* مطلق) نباید از یک روز بیشتر باشند. این مورد در پایتون 3.8 اصلاح شده است."
msgid "The :func:`asyncio.sleep` function."
msgstr "تابع :func:`asyncio.sleep`."
msgid "Creating futures and tasks"
msgstr "ایجاد آیندهنماها و وظایف"
msgid "Create an :class:`asyncio.Future` object attached to the event loop."
msgstr "یک شیء :class:`asyncio.Future` متصل به حلقه رویداد ایجاد کنید."
msgid "This is the preferred way to create Futures in asyncio. This lets third-party event loops provide alternative implementations of the Future object (with better performance or instrumentation)."
msgstr "این، روش ارجح برای ایجاد Futures در asyncio است. این روش به حلقههای رویداد شخص ثالث امکان میدهد پیادهسازیهای جایگزینی از شیء Future را ارائه کنند (با کارایی بهتر یا ابزاربندی (instrumentation))."
msgid "Schedule the execution of :ref:`coroutine <coroutine>` *coro*. Return a :class:`Task` object."
msgstr "اجرای :ref:`همروال <coroutine>` *coro* را زمانبندی میکند. یک شیء :class:`Task` را برمیگرداند."
msgid "Third-party event loops can use their own subclass of :class:`Task` for interoperability. In this case, the result type is a subclass of :class:`Task`."
msgstr "حلقههای رویداد شخص ثالث میتوانند برای تعاملپذیری از زیرکلاس اختصاصی خود از :class:`Task` استفاده کنند. در این حالت، نوع نتیجه یک زیرکلاس از :class:`Task` است."
msgid "The full function signature is largely the same as that of the :class:`Task` constructor (or factory) - all of the keyword arguments to this function are passed through to that interface."
msgstr "امضای کامل تابع تا حد زیادی مشابه امضای سازندهی :class:`Task` (یا کارخانه) است؛ تمام آرگومانهای کلیدواژهای این تابع به آن رابط منتقل میشوند."
msgid "If the *name* argument is provided and not ``None``, it is set as the name of the task using :meth:`Task.set_name`."
msgstr "اگر آرگومان *name* ارائه شده باشد و ``None`` نباشد، بهعنوان نام وظیفه با استفاده از :meth:`Task.set_name` تنظیم میشود."
msgid "An optional keyword-only *context* argument allows specifying a custom :class:`contextvars.Context` for the *coro* to run in. The current context copy is created when no *context* is provided."
msgstr "یک آرگومان *context* اختیاری و فقط کلیدواژهای امکان تعیین یک :class:`contextvars.Context` سفارشی را فراهم میکند تا *coro* در آن اجرا شود. در صورتی که *context* ارائه نشود، یک کپی از زمینه جاری ایجاد میشود."
msgid "An optional keyword-only *eager_start* argument allows specifying if the task should execute eagerly during the call to create_task, or be scheduled later. If *eager_start* is not passed the mode set by :meth:`loop.set_task_factory` will be used."
msgstr "یک آرگومان اختیاری فقط کلیدواژهای *eager_start* به شما امکان میدهد مشخص کنید که وظیفه باید در حین فراخوانی create_task بلافاصله اجرا شود یا بعداً زمانبندی شود. اگر *eager_start* ارسال نشود، حالت تنظیمشده توسط :meth:`loop.set_task_factory` استفاده خواهد شد."
msgid "Added the *name* parameter."
msgstr "پارامتر *name* افزوده شد."
msgid "Added the *context* parameter."
msgstr "پارامتر *context* افزوده شد."
msgid "Added ``kwargs`` which passes on arbitrary extra parameters, including ``name`` and ``context``."
msgstr "``kwargs`` افزوده شد که پارامترهای اضافی دلخواه، از جمله ``name`` و ``context`` را منتقل میکند."
msgid "Rolled back the change that passes on *name* and *context* (if it is None), while still passing on other arbitrary keyword arguments (to avoid breaking backwards compatibility with 3.13.3)."
msgstr "تغییری که *name* و *context* را (اگر None باشد) منتقل میکرد، بازگردانده شد، در حالی که همچنان سایر آرگومانهای کلیدواژهای دلخواه منتقل میشوند (برای جلوگیری از از بین رفتن سازگاری با نسخهی پیشین 3.13.3)."
msgid "All *kwargs* are now passed on. The *eager_start* parameter works with eager task factories."
msgstr "اکنون همهی *kwargs* منتقل میشوند. پارامتر *eager_start* با کارخانههای وظیفهی مشتاق (eager task factories) کار میکند."
msgid "Set a task factory that will be used by :meth:`loop.create_task`."
msgstr "یک کارخانهی وظیفه (task factory) تنظیم کنید که :meth:`loop.create_task` از آن استفاده خواهد کرد."
msgid "If *factory* is ``None`` the default task factory will be set. Otherwise, *factory* must be a *callable* with the signature matching ``(loop, coro, **kwargs)``, where *loop* is a reference to the active event loop, and *coro* is a coroutine object. The callable must pass on all *kwargs*, and return a :class:`asyncio.Task`-compatible object."
msgstr "اگر *factory* برابر ``None`` باشد، کارخانه وظیفه پیشفرض تنظیم خواهد شد. در غیر این صورت، *factory* باید یک شیء *فراخوانیپذیر* با امضایی مطابق با ``(loop, coro, **kwargs)`` باشد، که در آن *loop* مرجعی به حلقه رویداد فعال و *coro* یک شیء همروال است. این شیء فراخوانیپذیر باید تمام *kwargs* را منتقل کند و شیءای سازگار با :class:`asyncio.Task` برگرداند."
msgid "Required that all *kwargs* are passed on to :class:`asyncio.Task`."
msgstr "لازم است که تمام *kwargs* به :class:`asyncio.Task` منتقل شوند."
msgid "*name* is no longer passed to task factories. *context* is no longer passed to task factories if it is ``None``."
msgstr "دیگر *name* به کارخانههای وظیفه (task factories) ارسال نمیشود. اگر *context* برابر ``None`` باشد، دیگر به کارخانههای وظیفه (task factories) ارسال نمیشود."
msgid "*name* and *context* are now unconditionally passed on to task factories again."
msgstr "*name* و *context* اکنون دوباره بهصورت غیرشرطی به کارخانههای task پاس داده میشوند."
msgid "Return a task factory or ``None`` if the default one is in use."
msgstr "یک کارخانه وظیفه (task factory) برمیگرداند، یا اگر از کارخانه پیشفرض استفاده شود، ``None`` برمیگرداند."
msgid "Opening network connections"
msgstr "باز کردن اتصالات شبکه"
msgid "Open a streaming transport connection to a given address specified by *host* and *port*."
msgstr "باز کردن یک اتصال انتقال جریانی به نشانی مشخصشده با *host* و *port*."
msgid "The socket family can be either :py:const:`~socket.AF_INET` or :py:const:`~socket.AF_INET6` depending on *host* (or the *family* argument, if provided)."
msgstr "خانواده سوکت میتواند، بسته به *host* (یا آرگومان *family*، در صورت ارائه)، یا :py:const:`~socket.AF_INET` یا :py:const:`~socket.AF_INET6` باشد."
msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`."
msgstr "نوع سوکت :py:const:`~socket.SOCK_STREAM` خواهد بود."
msgid "*protocol_factory* must be a callable returning an :ref:`asyncio protocol <asyncio-protocol>` implementation."
msgstr "*protocol_factory* باید یک شیء فراخوانیپذیر باشد که یک پیادهسازی از :ref:`پروتکل asyncio <asyncio-protocol>` را برمیگرداند."
msgid "This method will try to establish the connection in the background. When successful, it returns a ``(transport, protocol)`` pair."
msgstr "این متد تلاش خواهد کرد اتصال را در پسزمینه برقرار کند. در صورت موفقیت، یک جفت ``(transport, protocol)`` برمیگرداند."
msgid "The chronological synopsis of the underlying operation is as follows:"
msgstr "خلاصهای از ترتیب زمانی عملیات زیربنایی به شرح زیر است:"
msgid "The connection is established and a :ref:`transport <asyncio-transport>` is created for it."
msgstr "اتصال برقرار میشود و یک :ref:`transport <asyncio-transport>` برای آن ایجاد میشود."
msgid "*protocol_factory* is called without arguments and is expected to return a :ref:`protocol <asyncio-protocol>` instance."
msgstr "*protocol_factory* بدون آرگومان فراخوانی میشود و انتظار میرود نمونهای از :ref:`protocol <asyncio-protocol>` را برگرداند."
msgid "The protocol instance is coupled with the transport by calling its :meth:`~BaseProtocol.connection_made` method."
msgstr "نمونهی پروتکل با فراخوانی متد :meth:`~BaseProtocol.connection_made` خود، به انتقال متصل میشود."
msgid "A ``(transport, protocol)`` tuple is returned on success."
msgstr "در صورت موفقیت، یک تاپل ``(transport, protocol)`` برگردانده میشود."
msgid "The created transport is an implementation-dependent bidirectional stream."
msgstr "انتقال ایجادشده، یک جریان دوطرفه وابسته به پیادهسازی است."
msgid "Other arguments:"
msgstr "آرگومانهای دیگر:"
msgid "*ssl*: if given and not false, a SSL/TLS transport is created (by default a plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` object, this context is used to create the transport; if *ssl* is :const:`True`, a default context returned from :func:`ssl.create_default_context` is used."
msgstr "*ssl*: اگر داده شده باشد و false نباشد، یک انتقال SSL/TLS ایجاد میشود (بهطور پیشفرض یک انتقال TCP ساده ایجاد میشود). اگر *ssl* یک شیء :class:`ssl.SSLContext` باشد، از این زمینه برای ایجاد انتقال استفاده میشود؛ اگر *ssl* :const:`True` باشد، از یک زمینه پیشفرض که از :func:`ssl.create_default_context` بازگشت داده میشود، استفاده میشود."
msgid ":ref:`SSL/TLS security considerations <ssl-security>`"
msgstr ":ref:`ملاحظات امنیتی SSL/TLS <ssl-security>`"
msgid "*server_hostname* sets or overrides the hostname that the target server's certificate will be matched against. Should only be passed if *ssl* is not ``None``. By default the value of the *host* argument is used. If *host* is empty, there is no default and you must pass a value for *server_hostname*. If *server_hostname* is an empty string, hostname matching is disabled (which is a serious security risk, allowing for potential man-in-the-middle attacks)."
msgstr "*server_hostname* نام میزبانی را که گواهی سرور هدف با آن تطبیق داده خواهد شد، تنظیم یا جایگزین میکند. این مقدار باید فقط در صورتی ارسال شود که *ssl* برابر ``None`` نباشد. بهطور پیشفرض، از مقدار آرگومان *host* استفاده میشود. اگر *host* خالی باشد، مقدار پیشفرضی وجود ندارد و شما باید مقداری برای *server_hostname* ارسال کنید. اگر *server_hostname* یک رشته خالی باشد، تطبیق نام میزبان غیرفعال میشود (که یک خطر امنیتی جدی است و امکان حملات مرد میانی بالقوه را فراهم میکند)."
msgid "*family*, *proto*, *flags* are the optional address family, protocol and flags to be passed through to getaddrinfo() for *host* resolution. If given, these should all be integers from the corresponding :mod:`socket` module constants."
msgstr "*family*، *proto* و *flags* خانوادهی آدرس، پروتکل و پرچمهای اختیاری هستند که برای تفکیک *host* به getaddrinfo() ارسال میشوند. اگر داده شوند، همهی اینها باید اعداد صحیحی از ثابتهای متناظر ماژول :mod:`socket` باشند."
msgid "*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this connection. It should be a floating-point number representing the amount of time in seconds to wait for a connection attempt to complete, before starting the next attempt in parallel. This is the \"Connection Attempt Delay\" as defined in :rfc:`8305`. A sensible default value recommended by the RFC is ``0.25`` (250 milliseconds)."
msgstr "*happy_eyeballs_delay*، در صورت ارائه، Happy Eyeballs را برای این اتصال فعال میکند. این باید یک عدد ممیز شناور باشد که مدتزمان به ثانیه برای انتظار جهت کامل شدن یک تلاش برای اتصال، پیش از آغاز تلاش بعدی بهصورت موازی را نشان میدهد. این همان «Connection Attempt Delay» است که در :rfc:`8305` تعریف شده است. مقدار پیشفرض معقولی که RFC توصیه کرده است، ``0.25`` (۲۵۰ میلیثانیه) است."
msgid "*interleave* controls address reordering when a host name resolves to multiple IP addresses. If ``0`` or unspecified, no reordering is done, and addresses are tried in the order returned by :meth:`getaddrinfo`. If a positive integer is specified, the addresses are interleaved by address family, and the given integer is interpreted as \"First Address Family Count\" as defined in :rfc:`8305`. The default is ``0`` if *happy_eyeballs_delay* is not specified, and ``1`` if it is."
msgstr "*interleave* بازچینش نشانیها را هنگامی که یک نام میزبان به چند نشانی IP حل میشود، کنترل میکند. اگر ``0`` باشد یا مشخصنشده باشد، هیچ بازچینشی انجام نمیشود و نشانیها به همان ترتیبی که :meth:`getaddrinfo` آنها را برمیگرداند امتحان میشوند. اگر یک عدد صحیح مثبت مشخص شود، نشانیها بر اساس خانوادهی نشانی بهصورت میانبافت (interleaved) چیده میشوند و عدد صحیح دادهشده بهعنوان «تعداد اولین خانوادهی نشانی (First Address Family Count)» تعریفشده در :rfc:`8305` تفسیر میشود. مقدار پیشفرض در صورتی که *happy_eyeballs_delay* مشخصنشده باشد ``0`` و در صورتی که مشخصشده باشد ``1`` است."
msgid "*sock*, if given, should be an existing, already connected :class:`socket.socket` object to be used by the transport. If *sock* is given, none of *host*, *port*, *family*, *proto*, *flags*, *happy_eyeballs_delay*, *interleave* and *local_addr* should be specified."
msgstr "*sock*، در صورت ارائه، باید یک شیء :class:`socket.socket` موجود و از پیش متصل باشد تا توسط انتقال استفاده شود. اگر *sock* ارائه شده باشد، نباید هیچکدام از *host*، *port*، *family*، *proto*، *flags*، *happy_eyeballs_delay*، *interleave* و *local_addr* مشخص شوند."
msgid "The *sock* argument transfers ownership of the socket to the transport created. To close the socket, call the transport's :meth:`~asyncio.BaseTransport.close` method."
msgstr "آرگومان *sock* مالکیت سوکت را به ترابری ایجادشده منتقل میکند. برای بستن سوکت، متد :meth:`~asyncio.BaseTransport.close` همان ترابری را فراخوانی کنید."
msgid "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind the socket locally. The *local_host* and *local_port* are looked up using ``getaddrinfo()``, similarly to *host* and *port*."
msgstr "*local_addr*، در صورت ارائه، یک تاپل ``(local_host, local_port)`` است که برای مقید کردن سوکت بهصورت محلی استفاده میشود. *local_host* و *local_port* نیز مانند *host* و *port* با استفاده از ``getaddrinfo()`` جستجو میشوند."
msgid "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to wait for the TLS handshake to complete before aborting the connection. ``60.0`` seconds if ``None`` (default)."
msgstr "*ssl_handshake_timeout* (برای یک اتصال TLS) مدتزمانی به ثانیه است که باید پیش از لغو اتصال، برای تکمیل دستدهی TLS (TLS handshake) منتظر ماند. در صورت ``None`` بودن، ``60.0`` ثانیه است (پیشفرض)."
msgid "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown to complete before aborting the connection. ``30.0`` seconds if ``None`` (default)."
msgstr "*ssl_shutdown_timeout* زمان انتظار بر حسب ثانیه برای کامل شدن خاموشی SSL (SSL shutdown) پیش از قطع اتصال است. اگر ``None`` (پیشفرض) باشد، ``30.0`` ثانیه است."
msgid "*all_errors* determines what exceptions are raised when a connection cannot be created. By default, only a single ``Exception`` is raised: the first exception if there is only one or all errors have same message, or a single ``OSError`` with the error messages combined. When ``all_errors`` is ``True``, an ``ExceptionGroup`` will be raised containing all exceptions (even if there is only one)."
msgstr "*all_errors* تعیین میکند که وقتی نمیتوان یک اتصال ایجاد کرد، چه استثناهایی پرتاب میشوند. بهطور پیشفرض، فقط یک ``Exception`` واحد پرتاب میشود: اولین استثنا اگر فقط یکی وجود داشته باشد یا همهی خطاها پیام یکسانی داشته باشند، یا یک ``OSError`` واحد با پیامهای خطای ترکیبشده. وقتی ``all_errors`` برابر ``True`` باشد، یک ``ExceptionGroup`` پرتاب خواهد شد که شامل همهی استثناها میشود (حتی اگر فقط یکی وجود داشته باشد)."
msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`."
msgstr "پشتیبانی از SSL/TLS در :class:`ProactorEventLoop` افزوده شد."
msgid "The socket option :ref:`socket.TCP_NODELAY <socket-unix-constants>` is set by default for all TCP connections."
msgstr "گزینهی سوکت :ref:`socket.TCP_NODELAY <socket-unix-constants>` بهطور پیشفرض برای تمام اتصالات TCP تنظیم شده است."
msgid "Added the *ssl_handshake_timeout* parameter."
msgstr "پارامتر *ssl_handshake_timeout* اضافه شد."
msgid "Added the *happy_eyeballs_delay* and *interleave* parameters."
msgstr "پارامترهای *happy_eyeballs_delay* و *interleave* افزوده شدند."
msgid "Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's IPv4 path and protocol are working, but the server's IPv6 path and protocol are not working, a dual-stack client application experiences significant connection delay compared to an IPv4-only client. This is undesirable because it causes the dual-stack client to have a worse user experience. This document specifies requirements for algorithms that reduce this user-visible delay and provides an algorithm."
msgstr "الگوریتم Happy Eyeballs: موفقیت با میزبانهای دو پشتهای. هنگامی که مسیر و پروتکل IPv4 یک سرور کار میکنند، اما مسیر و پروتکل IPv6 آن سرور کار نمیکنند، یک برنامه کلاینت دو پشتهای در مقایسه با یک کلاینت فقط IPv4 با تأخیر قابلتوجهی در اتصال مواجه میشود. این وضعیت نامطلوب است، زیرا باعث میشود کلاینت دو پشتهای تجربه کاربری بدتری داشته باشد. این سند الزامات الگوریتمهایی را که این تأخیر قابلمشاهده برای کاربر را کاهش میدهند، مشخص میکند و یک الگوریتم ارائه میدهد."
msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555"
msgstr "برای اطلاعات بیشتر: https://datatracker.ietf.org/doc/html/rfc6555"
msgid "Added the *ssl_shutdown_timeout* parameter."
msgstr "پارامتر *ssl_shutdown_timeout* اضافه شد."
msgid "*all_errors* was added."
msgstr "*all_errors* افزوده شد."
msgid "The :func:`open_connection` function is a high-level alternative API. It returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be used directly in async/await code."
msgstr "تابع :func:`open_connection` یک API جایگزین سطحبالا است. این تابع یک جفت (:class:`StreamReader`، :class:`StreamWriter`) را برمیگرداند که میتوان مستقیماً در کد async/await از آنها استفاده کرد."
msgid "Create a datagram connection."
msgstr "یک اتصال دیتاگرام ایجاد کنید."
msgid "The socket family can be either :py:const:`~socket.AF_INET`, :py:const:`~socket.AF_INET6`, or :py:const:`~socket.AF_UNIX`, depending on *host* (or the *family* argument, if provided)."
msgstr "خانواده سوکت میتواند یکی از :py:const:`~socket.AF_INET`، :py:const:`~socket.AF_INET6` یا :py:const:`~socket.AF_UNIX` باشد، بسته به *host* (یا آرگومان *family*، در صورت ارائه)."
msgid "The socket type will be :py:const:`~socket.SOCK_DGRAM`."
msgstr "نوع سوکت برابر با :py:const:`~socket.SOCK_DGRAM` خواهد بود."
msgid "*protocol_factory* must be a callable returning a :ref:`protocol <asyncio-protocol>` implementation."
msgstr "*protocol_factory* باید یک شیء فراخوانیپذیر باشد که یک پیادهسازی :ref:`پروتکل <asyncio-protocol>` را برمیگرداند."
msgid "A tuple of ``(transport, protocol)`` is returned on success."
msgstr "در صورت موفقیت، یک تاپل از ``(transport, protocol)`` برگردانده میشود."
msgid "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind the socket locally. The *local_host* and *local_port* are looked up using :meth:`getaddrinfo`."
msgstr "*local_addr*، در صورت ارائه، یک تاپل ``(local_host, local_port)`` است که برای پیوند دادن سوکت بهصورت محلی استفاده میشود. *local_host* و *local_port* با استفاده از :meth:`getaddrinfo` جستجو میشوند."
msgid "On Windows, when using the proactor event loop with ``local_addr=None``, an :exc:`OSError` with :attr:`!errno.WSAEINVAL` will be raised when running it."
msgstr "در ویندوز، هنگام استفاده از حلقه رویداد proactor با ``local_addr=None``، در زمان اجرا یک :exc:`OSError` با :attr:`!errno.WSAEINVAL` پرتاب میشود."
msgid "*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to connect the socket to a remote address. The *remote_host* and *remote_port* are looked up using :meth:`getaddrinfo`."
msgstr "*remote_addr*، در صورت ارائه، یک تاپل به شکل ``(remote_host, remote_port)`` است که برای اتصال سوکت به یک نشانی دوردست استفاده میشود. *remote_host* و *remote_port* با استفاده از :meth:`getaddrinfo` جستجو میشوند."
msgid "*family*, *proto*, *flags* are the optional address family, protocol and flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If given, these should all be integers from the corresponding :mod:`socket` module constants."
msgstr "*family*، *proto* و *flags* خانوادهی نشانی، پروتکل و پرچمهای اختیاری هستند که باید برای وضوح *host* به :meth:`getaddrinfo` ارسال شوند. در صورت ارائه، همهی این موارد باید اعداد صحیحی از ثابتهای متناظر ماژول :mod:`socket` باشند."
msgid "*reuse_port* tells the kernel to allow this endpoint to be bound to the same port as other existing endpoints are bound to, so long as they all set this flag when being created. This option is not supported on Windows and some Unixes. If the :ref:`socket.SO_REUSEPORT <socket-unix-constants>` constant is not defined then this capability is unsupported."
msgstr "*reuse_port* به هسته میگوید که اجازه دهد این پایانه به همان پورتی متصل شود که سایر پایانههای موجود به آن متصل هستند، مشروط بر اینکه همهی آنها این پرچم را هنگام ایجاد تنظیم کنند. این گزینه در ویندوز و برخی یونیکسها پشتیبانی نمیشود. اگر ثابت :ref:`socket.SO_REUSEPORT <socket-unix-constants>` تعریف نشده باشد، این قابلیت پشتیبانی نمیشود."
msgid "*allow_broadcast* tells the kernel to allow this endpoint to send messages to the broadcast address."
msgstr "*allow_broadcast* به هسته میگوید که به این پایانه اجازه دهد پیامها را به نشانی پخش (broadcast address) ارسال کند."
msgid "*sock* can optionally be specified in order to use a preexisting, already connected, :class:`socket.socket` object to be used by the transport. If specified, *local_addr* and *remote_addr* should be omitted (must be :const:`None`)."
msgstr "*sock* میتواند بهصورت اختیاری مشخص شود تا از یک شیء :class:`socket.socket` از پیش موجود و متصلشده توسط انتقال استفاده شود. در صورت مشخص شدن، *local_addr* و *remote_addr* باید حذف شوند (باید :const:`None` باشند)."
msgid "See :ref:`UDP echo client protocol <asyncio-udp-echo-client-protocol>` and :ref:`UDP echo server protocol <asyncio-udp-echo-server-protocol>` examples."
msgstr "مثالهای :ref:`پروتکل کلاینت اکو UDP <asyncio-udp-echo-client-protocol>` و :ref:`پروتکل سرور اکو UDP <asyncio-udp-echo-server-protocol>` را ببینید."
msgid "The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*, *allow_broadcast*, and *sock* parameters were added."
msgstr "پارامترهای *family*، *proto*، *flags*، *reuse_address*، *reuse_port*، *allow_broadcast* و *sock* افزوده شدهاند."
msgid "Added support for Windows."
msgstr "پشتیبانی از ویندوز اضافه شد."
msgid "The *reuse_address* parameter is no longer supported, as using :ref:`socket.SO_REUSEADDR <socket-unix-constants>` poses a significant security concern for UDP. Explicitly passing ``reuse_address=True`` will raise an exception."
msgstr "پارامتر *reuse_address* دیگر پشتیبانی نمیشود، زیرا استفاده از :ref:`socket.SO_REUSEADDR <socket-unix-constants>` یک نگرانی امنیتی جدی برای UDP به همراه دارد. ارسال صریح ``reuse_address=True`` منجر به پرتاب استثنا خواهد شد."
msgid "When multiple processes with differing UIDs assign sockets to an identical UDP socket address with ``SO_REUSEADDR``, incoming packets can become randomly distributed among the sockets."
msgstr "وقتی چندین فرایند با UIDهای متفاوت، با ``SO_REUSEADDR`` سوکتها را به یک آدرس سوکت UDP یکسان اختصاص میدهند، بستههای ورودی ممکن است بهصورت تصادفی بین سوکتها توزیع شوند."
msgid "For supported platforms, *reuse_port* can be used as a replacement for similar functionality. With *reuse_port*, :ref:`socket.SO_REUSEPORT <socket-unix-constants>` is used instead, which specifically prevents processes with differing UIDs from assigning sockets to the same socket address."
msgstr "در پلتفرمهای پشتیبانیشده، میتوان از *reuse_port* بهعنوان جایگزینی برای عملکرد مشابه استفاده کرد. با *reuse_port*، بهجای آن از :ref:`socket.SO_REUSEPORT <socket-unix-constants>` استفاده میشود، که بهطور مشخص از اختصاص دادن سوکتها به یک آدرس سوکت یکسان توسط فرآیندهایی با UIDهای متفاوت جلوگیری میکند."
msgid "The *reuse_address* parameter, disabled since Python 3.8.1, 3.7.6 and 3.6.10, has been entirely removed."
msgstr "پارامتر *reuse_address* که از پایتون 3.8.1، 3.7.6 و 3.6.10 غیرفعال شده بود، بهطور کامل حذف شده است."
msgid "Create a Unix connection."
msgstr "ایجاد یک اتصال Unix."
msgid "The socket family will be :py:const:`~socket.AF_UNIX`; socket type will be :py:const:`~socket.SOCK_STREAM`."
msgstr "خانواده سوکت :py:const:`~socket.AF_UNIX` خواهد بود؛ نوع سوکت :py:const:`~socket.SOCK_STREAM` خواهد بود."
msgid "*path* is the name of a Unix domain socket and is required, unless a *sock* parameter is specified. Abstract Unix sockets, :class:`str`, :class:`bytes`, and :class:`~pathlib.Path` paths are supported."
msgstr "*path* نام یک سوکت دامنهی یونیکس است و الزامی است، مگر اینکه پارامتر *sock* مشخص شده باشد. از سوکتهای انتزاعی یونیکس و مسیرهای :class:`str`، :class:`bytes` و :class:`~pathlib.Path` پشتیبانی میشود."
msgid "See the documentation of the :meth:`loop.create_connection` method for information about arguments to this method."
msgstr "برای اطلاعات درباره آرگومانهای این متد، مستندات متد :meth:`loop.create_connection` را ببینید."
msgid "Availability"
msgstr "دسترسپذیری"
msgid "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be a :term:`path-like object`."
msgstr "پارامتر *ssl_handshake_timeout* اضافه شد. پارامتر *path* اکنون میتواند یک :term:`path-like object` باشد."
msgid "Creating network servers"
msgstr "ایجاد سرورهای شبکه"
msgid "Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on *port* of the *host* address."
msgstr "یک سرور TCP (نوع سوکت :const:`~socket.SOCK_STREAM`) ایجاد کنید که روی *port* از آدرس *host* گوش میدهد."
msgid "Returns a :class:`Server` object."
msgstr "یک شیء :class:`Server` برمیگرداند."
msgid "Arguments:"
msgstr "آرگومانها:"
msgid "The *host* parameter can be set to several types which determine where the server would be listening:"
msgstr "پارامتر *host* را میتوان روی چندین نوع تنظیم کرد که تعیین میکنند سرور در کجا گوش میدهد:"
msgid "If *host* is a string, the TCP server is bound to a single network interface specified by *host*."
msgstr "اگر *host* یک رشته باشد، سرور TCP به یک رابط شبکه واحد که توسط *host* مشخص شده است، مقید میشود."
msgid "If *host* is a sequence of strings, the TCP server is bound to all network interfaces specified by the sequence."
msgstr "اگر *host* دنبالهای از رشتهها باشد، سرور TCP به همه رابطهای شبکه مشخصشده توسط آن دنباله مقید میشود."
msgid "If *host* is an empty string or ``None``, all interfaces are assumed and a list of multiple sockets will be returned (most likely one for IPv4 and another one for IPv6)."
msgstr "اگر *host* یک رشته خالی یا ``None`` باشد، همه رابطها در نظر گرفته میشوند و فهرستی از چندین سوکت برگردانده میشود (به احتمال زیاد یکی برای IPv4 و دیگری برای IPv6)."
msgid "The *port* parameter can be set to specify which port the server should listen on. If ``0`` or ``None`` (the default), a random unused port will be selected (note that if *host* resolves to multiple network interfaces, a different random port will be selected for each interface)."
msgstr "میتوان پارامتر *port* را برای مشخص کردن پورتی که سرور باید روی آن گوش دهد تنظیم کرد. اگر ``0`` یا ``None`` (پیشفرض) باشد، یک پورت تصادفی استفادهنشده انتخاب خواهد شد (توجه داشته باشید که اگر *host* به چند رابط شبکه تفکیک شود، برای هر رابط یک پورت تصادفی متفاوت انتخاب خواهد شد)."
msgid "*family* can be set to either :const:`socket.AF_INET` or :const:`~socket.AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* will be determined from host name (defaults to :const:`~socket.AF_UNSPEC`)."
msgstr "*family* میتواند روی :const:`socket.AF_INET` یا :const:`~socket.AF_INET6` تنظیم شود تا سوکت را وادار به استفاده از IPv4 یا IPv6 کند. اگر تنظیم نشود، *family* بر اساس نام میزبان تعیین میشود (پیشفرض :const:`~socket.AF_UNSPEC` است)."
msgid "*flags* is a bitmask for :meth:`getaddrinfo`."
msgstr "*flags* یک نقاب بیتی (bitmask) برای :meth:`getaddrinfo` است."
msgid "*sock* can optionally be specified in order to use a preexisting socket object. If specified, *host* and *port* must not be specified."
msgstr "*sock* را میتوان بهصورت اختیاری برای استفاده از یک شیء سوکت از پیش موجود تعیین کرد. اگر تعیین شود، *host* و *port* نباید تعیین شوند."
msgid "The *sock* argument transfers ownership of the socket to the server created. To close the socket, call the server's :meth:`~asyncio.Server.close` method."
msgstr "آرگومان *sock* مالکیت سوکت را به سرور ایجادشده منتقل میکند. برای بستن سوکت، متد :meth:`~asyncio.Server.close` سرور را فراخوانی کنید."
msgid "*backlog* is the maximum number of queued connections passed to :meth:`~socket.socket.listen` (defaults to 100)."
msgstr "*backlog* حداکثر تعداد اتصالهای در صف است که به :meth:`~socket.socket.listen` داده میشود (پیشفرض ۱۰۰ است)."
msgid "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over the accepted connections."
msgstr "*ssl* را میتوان به یک نمونه از :class:`~ssl.SSLContext` تنظیم کرد تا TLS روی اتصالهای پذیرفتهشده فعال شود."
msgid "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` state, without waiting for its natural timeout to expire. If not specified will automatically be set to ``True`` on Unix."
msgstr "*reuse_address* به هسته میگوید که از یک سوکت محلی در وضعیت ``TIME_WAIT`` دوباره استفاده کند، بدون اینکه منتظر پایان مهلت زمانی طبیعی آن بماند. اگر تعییننشده باشد، در Unix بهطور خودکار روی ``True`` تنظیم خواهد شد."
msgid "*reuse_port* tells the kernel to allow this endpoint to be bound to the same port as other existing endpoints are bound to, so long as they all set this flag when being created. This option is not supported on Windows."
msgstr "*reuse_port* به هسته میگوید که اجازه دهد این پایانه به همان پورتی که سایر پایانههای موجود به آن مقید شدهاند، مقید شود، مشروط بر اینکه همهی آنها نیز این پرچم را هنگام ایجاد تنظیم کرده باشند. این گزینه در ویندوز پشتیبانی نمیشود."
msgid "*keep_alive* set to ``True`` keeps connections active by enabling the periodic transmission of messages."
msgstr "با تنظیم *keep_alive* روی ``True``، اتصالها با فعالسازی ارسال دورهای پیامها فعال نگه داشته میشوند."
msgid "Added the *keep_alive* parameter."
msgstr "پارامتر *keep_alive* اضافه شد."
msgid "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait for the TLS handshake to complete before aborting the connection. ``60.0`` seconds if ``None`` (default)."
msgstr "*ssl_handshake_timeout* (برای یک سرور TLS) مدتزمان انتظار به ثانیه برای کاملشدن دستدهی TLS پیش از قطع اتصال است. اگر ``None`` (پیشفرض) باشد، ``60.0`` ثانیه است."
msgid "*start_serving* set to ``True`` (the default) causes the created server to start accepting connections immediately. When set to ``False``, the user should await on :meth:`Server.start_serving` or :meth:`Server.serve_forever` to make the server to start accepting connections."
msgstr "تنظیم *start_serving* روی ``True`` (پیشفرض) باعث میشود سرور ایجادشده بلافاصله پذیرش اتصالها را آغاز کند. هنگامی که روی ``False`` تنظیم شود، کاربر باید :meth:`Server.start_serving` یا :meth:`Server.serve_forever` را await کند تا سرور پذیرش اتصالها را آغاز کند."
msgid "The *host* parameter can be a sequence of strings."
msgstr "پارامتر *host* میتواند دنبالهای از رشتهها باشد."
msgid "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket option :ref:`socket.TCP_NODELAY <socket-unix-constants>` is set by default for all TCP connections."
msgstr "پارامترهای *ssl_handshake_timeout* و *start_serving* افزوده شدند. گزینهی سوکت :ref:`socket.TCP_NODELAY <socket-unix-constants>` بهطور پیشفرض برای تمام اتصالات TCP تنظیم میشود."
msgid "The :func:`start_server` function is a higher-level alternative API that returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can be used in an async/await code."
msgstr "تابع :func:`start_server` یک API جایگزین سطح بالاتر است که یک جفت :class:`StreamReader` و :class:`StreamWriter` را برمیگرداند و میتوان از آنها در کد ناهمگام/await استفاده کرد."
msgid "Similar to :meth:`loop.create_server` but works with the :py:const:`~socket.AF_UNIX` socket family."
msgstr "مشابه :meth:`loop.create_server` است اما با خانوادهی سوکت :py:const:`~socket.AF_UNIX` کار میکند."
msgid "*path* is the name of a Unix domain socket, and is required, unless a *sock* argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, and :class:`~pathlib.Path` paths are supported."
msgstr "*path* نام یک سوکت دامنه Unix است و لازم است، مگر اینکه آرگومان *sock* ارائه شده باشد. سوکتهای انتزاعی Unix، مسیرهای :class:`str`، :class:`bytes` و :class:`~pathlib.Path` پشتیبانی میشوند."
msgid "If *cleanup_socket* is true then the Unix socket will automatically be removed from the filesystem when the server is closed, unless the socket has been replaced after the server has been created."
msgstr "اگر *cleanup_socket* درست باشد، سوکت یونیکس بهصورت خودکار هنگام بسته شدن سرور از سامانه فایلبندی حذف میشود، مگر اینکه سوکت پس از ایجاد سرور جایگزین شده باشد."
msgid "See the documentation of the :meth:`loop.create_server` method for information about arguments to this method."
msgstr "برای اطلاعات درباره آرگومانهای این متد، مستندات متد :meth:`loop.create_server` را ببینید."
msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* parameter can now be a :class:`~pathlib.Path` object."
msgstr "پارامترهای *ssl_handshake_timeout* و *start_serving* افزوده شدند. پارامتر *path* اکنون میتواند یک شیء :class:`~pathlib.Path` باشد."
msgid "Added the *cleanup_socket* parameter."
msgstr "پارامتر *cleanup_socket* افزوده شد."
msgid "Wrap an already accepted connection into a transport/protocol pair."
msgstr "یک اتصال از پیش پذیرفتهشده را در یک جفت انتقال/پروتکل قرار دهید."
msgid "This method can be used by servers that accept connections outside of asyncio but that use asyncio to handle them."
msgstr "این متد برای سرورهایی قابل استفاده است که اتصالها را خارج از asyncio میپذیرند، اما برای مدیریت آنها از asyncio استفاده میکنند."
msgid "Parameters:"
msgstr "پارامترها:"
msgid "*sock* is a preexisting socket object returned from :meth:`socket.accept <socket.socket.accept>`."
msgstr "*sock* یک شیء سوکت از پیش موجود است که از :meth:`socket.accept <socket.socket.accept>` برگرداندهشده است."
msgid "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the accepted connections."
msgstr "*ssl* را میتوان به یک :class:`~ssl.SSLContext` تنظیم کرد تا SSL روی اتصالات پذیرفتهشده فعال شود."
msgid "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to wait for the SSL handshake to complete before aborting the connection. ``60.0`` seconds if ``None`` (default)."
msgstr "*ssl_handshake_timeout* (برای یک اتصال SSL) زمان انتظار به ثانیه برای تکمیل دستدهی SSL (SSL handshake) پیش از قطع اتصال است. اگر ``None`` باشد (پیشفرض)، ``60.0`` ثانیه است."
msgid "Returns a ``(transport, protocol)`` pair."
msgstr "یک جفت ``(transport, protocol)`` برمیگرداند."
msgid "Transferring files"
msgstr "انتقال پروندهها"
msgid "Send a *file* over a *transport*. Return the total number of bytes sent."
msgstr "یک *پرونده* را بر بستر یک *انتقال* ارسال میکند. تعداد کل بایتهای ارسالشده را برمیگرداند."
msgid "The method uses high-performance :meth:`os.sendfile` if available."
msgstr "این متد در صورت موجود بودن، از :meth:`os.sendfile` با کارایی بالا استفاده میکند."
msgid "*file* must be a regular file object opened in binary mode."
msgstr "*file* باید یک شیء پرونده معمولی باشد که در حالت دودویی باز شده باشد."
msgid "*offset* tells from where to start reading the file. If specified, *count* is the total number of bytes to transmit as opposed to sending the file until EOF is reached. File position is always updated, even when this method raises an error, and :meth:`file.tell() <io.IOBase.tell>` can be used to obtain the actual number of bytes sent."
msgstr "*offset* مشخص میکند که خواندن پرونده از کجا آغاز شود. اگر مشخص شود، *count* تعداد کل بایتهایی است که باید ارسال شوند، بهجای ارسال پرونده تا رسیدن به EOF. موقعیت پرونده همواره بهروزرسانی میشود، حتی هنگامی که این متد خطایی را پرتاب میکند، و میتوان از :meth:`file.tell() <io.IOBase.tell>` برای به دست آوردن تعداد واقعی بایتهای ارسالشده استفاده کرد."
msgid "*fallback* set to ``True`` makes asyncio to manually read and send the file when the platform does not support the sendfile system call (e.g. Windows or SSL socket on Unix)."
msgstr "تنظیم *fallback* روی ``True`` باعث میشود asyncio زمانی که پلتفرم از فراخوانی سیستمی sendfile پشتیبانی نمیکند (مثلاً Windows یا سوکت SSL در Unix)، پرونده را بهصورت دستی بخواند و ارسال کند."
msgid "Raise :exc:`SendfileNotAvailableError` if the system does not support the *sendfile* syscall and *fallback* is ``False``."
msgstr "اگر سیستم از فراخوانی سیستمی *sendfile* پشتیبانی نکند و *fallback* برابر ``False`` باشد، :exc:`SendfileNotAvailableError` پرتاب میشود."
msgid "TLS upgrade"
msgstr "ارتقاء TLS"
msgid "Upgrade an existing transport-based connection to TLS."
msgstr "یک اتصال مبتنی بر ترابری موجود را به TLS ارتقا دهید."
msgid "Create a TLS coder/decoder instance and insert it between the *transport* and the *protocol*. The coder/decoder implements both *transport*-facing protocol and *protocol*-facing transport."
msgstr "یک نمونه از کدگذار/کدگشای TLS ایجاد کنید و آن را میان *انتقال* و *پروتکل* قرار دهید. کدگذار/کدگشا هم پروتکل مواجه با *انتقال* و هم انتقال مواجه با *پروتکل* را پیادهسازی میکند."
msgid "Return the created two-interface instance. After *await*, the *protocol* must stop using the original *transport* and communicate with the returned object only because the coder caches *protocol*-side data and sporadically exchanges extra TLS session packets with *transport*."
msgstr "نمونهی دو-رابطی ایجادشده را برمیگرداند. پس از *await*، *protocol* باید استفاده از *transport* اصلی را متوقف کند و فقط با شیء برگرداندهشده ارتباط برقرار کند، زیرا کدکننده دادههای سمت *protocol* را در نهانگاه ذخیره میکند و بهصورت پراکنده بستههای اضافی نشست TLS را با *transport* مبادله میکند."
msgid "In some situations (e.g. when the passed transport is already closing) this may return ``None``."
msgstr "در برخی شرایط (مثلاً وقتی انتقال ارسالشده از قبل در حال بستهشدن است) ممکن است این ``None`` را برگرداند."
msgid "*transport* and *protocol* instances that methods like :meth:`~loop.create_server` and :meth:`~loop.create_connection` return."
msgstr "نمونههای *transport* و *protocol* که متدهایی مانند :meth:`~loop.create_server` و :meth:`~loop.create_connection` برمیگردانند."
msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`."
msgstr "*sslcontext*: یک نمونه پیکربندیشده از :class:`~ssl.SSLContext`."
msgid "*server_side* pass ``True`` when a server-side connection is being upgraded (like the one created by :meth:`~loop.create_server`)."
msgstr "*server_side* هنگامی که یک اتصال سمت سرور در حال ارتقا است، ``True`` را ارسال کنید (مانند اتصالی که توسط :meth:`~loop.create_server` ایجاد میشود)."
msgid "*server_hostname*: sets or overrides the host name that the target server's certificate will be matched against."
msgstr "*server_hostname*: نام میزبانی را که گواهی سرور هدف با آن تطبیق داده خواهد شد، تنظیم یا بازنویسی میکند."
msgid "Watching file descriptors"
msgstr "پایش توصیفگرهای پرونده"
msgid "Start monitoring the *fd* file descriptor for read availability and invoke *callback* with the specified arguments once *fd* is available for reading."
msgstr "پایش توصیفگر پرونده *fd* را برای دسترسپذیری جهت خواندن آغاز کنید و هنگامی که *fd* برای خواندن در دسترس شد، *callback* را با آرگومانهای مشخصشده فراخوانی کنید."
msgid "Any preexisting callback registered for *fd* is cancelled and replaced by *callback*."
msgstr "هر کالبک از پیش ثبتشده برای *fd* لغو میشود و با *callback* جایگزین میشود."
msgid "Stop monitoring the *fd* file descriptor for read availability. Returns ``True`` if *fd* was previously being monitored for reads."
msgstr "پایش توصیفگر پرونده *fd* را برای دسترسپذیری جهت خواندن متوقف میکند. اگر *fd* پیشتر برای خواندن پایش میشد، ``True`` برمیگرداند."
msgid "Start monitoring the *fd* file descriptor for write availability and invoke *callback* with the specified arguments *args* once *fd* is available for writing."
msgstr "پایش توصیفگر پرونده *fd* را برای دسترسپذیری جهت نوشتن آغاز کنید و هرگاه *fd* برای نوشتن در دسترس بود، *callback* را با آرگومانهای مشخصشده *args* فراخوانی کنید."
msgid "Use :func:`functools.partial` :ref:`to pass keyword arguments <asyncio-pass-keywords>` to *callback*."
msgstr "برای :ref:`ارسال آرگومانهای کلیدواژهای <asyncio-pass-keywords>` به *کالبک* از :func:`functools.partial` استفاده کنید."
msgid "Stop monitoring the *fd* file descriptor for write availability. Returns ``True`` if *fd* was previously being monitored for writes."
msgstr "پایش توصیفگر پرونده *fd* را از نظر دسترسپذیری برای نوشتن متوقف میکند. اگر *fd* پیشتر برای نوشتن پایش میشد، ``True`` را برمیگرداند."
msgid "See also :ref:`Platform Support <asyncio-platform-support>` section for some limitations of these methods."
msgstr "همچنین برای برخی محدودیتهای این متدها، بخش :ref:`Platform Support <asyncio-platform-support>` را ببینید."
msgid "Working with socket objects directly"
msgstr "کار مستقیم با اشیای سوکت"
msgid "In general, protocol implementations that use transport-based APIs such as :meth:`loop.create_connection` and :meth:`loop.create_server` are faster than implementations that work with sockets directly. However, there are some use cases when performance is not critical, and working with :class:`~socket.socket` objects directly is more convenient."
msgstr "بهطور کلی، پیادهسازیهای پروتکلی که از APIهای مبتنی بر انتقال مانند :meth:`loop.create_connection` و :meth:`loop.create_server` استفاده میکنند، سریعتر از پیادهسازیهایی هستند که بهطور مستقیم با سوکتها کار میکنند. با این حال، برخی موارد استفاده وجود دارند که در آنها عملکرد اهمیت حیاتی ندارد و کار مستقیم با اشیای :class:`~socket.socket` راحتتر است."
msgid "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket.recv() <socket.socket.recv>`."
msgstr "حداکثر *nbytes* را از *sock* دریافت میکند. نسخه ناهمگام :meth:`socket.recv() <socket.socket.recv>` است."
msgid "Return the received data as a bytes object."
msgstr "دادههای دریافتشده را بهعنوان یک شیء bytes برگردانید."
msgid "*sock* must be a non-blocking socket."
msgstr "*sock* باید سوکتی غیرمسدود باشد."
msgid "Even though this method was always documented as a coroutine method, releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this is an ``async def`` method."
msgstr "اگرچه این متد همیشه بهعنوان یک متد همروال مستند شده بود، نسخههای پیش از پایتون 3.7 یک :class:`Future` برمیگرداندند. از پایتون 3.7، این یک متد ``async def`` است."
msgid "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :meth:`socket.recv_into() <socket.socket.recv_into>` method."
msgstr "دادهها را از *sock* به بافر *buf* دریافت میکند. بر اساس متد مسدودکنندهی :meth:`socket.recv_into() <socket.socket.recv_into>` طراحی شده است."
msgid "Return the number of bytes written to the buffer."
msgstr "تعداد بایتهای نوشتهشده در بافر را برمیگرداند."
msgid "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :meth:`socket.recvfrom() <socket.socket.recvfrom>`."
msgstr "یک دیتاگرام با حداکثر اندازهی *bufsize* را از *sock* دریافت کنید. نسخهی ناهمگام از :meth:`socket.recvfrom() <socket.socket.recvfrom>`."
msgid "Return a tuple of (received data, remote address)."
msgstr "تاپلی از (داده دریافتی، نشانی دوردست) برمیگرداند."
msgid "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous version of :meth:`socket.recvfrom_into() <socket.socket.recvfrom_into>`."
msgstr "یک دیتاگرام تا حداکثر *nbytes* را از *sock* در *buf* دریافت کنید. نسخهی ناهمگام :meth:`socket.recvfrom_into() <socket.socket.recvfrom_into>` است."
msgid "Return a tuple of (number of bytes received, remote address)."
msgstr "یک تاپل شامل (تعداد بایتهای دریافتشده، نشانی دوردست) برمیگرداند."
msgid "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket.sendall() <socket.socket.sendall>`."
msgstr "*data* را به سوکت *sock* ارسال میکند. نسخهی ناهمگام :meth:`socket.sendall() <socket.socket.sendall>`."
msgid "This method continues to send to the socket until either all data in *data* has been sent or an error occurs. ``None`` is returned on success. On error, an exception is raised. Additionally, there is no way to determine how much data, if any, was successfully processed by the receiving end of the connection."
msgstr "این متد ارسال به سوکت را تا زمانی ادامه میدهد که یا تمام دادههای موجود در *data* ارسال شده باشد یا خطایی رخ دهد. در صورت موفقیت، ``None`` برگردانده میشود. در صورت بروز خطا، یک استثنا پرتاب میشود. علاوه بر این، راهی برای تعیین اینکه چه مقدار داده، در صورت وجود، در سمت دریابندهی اتصال با موفقیت پردازش شده است، وجود ندارد."
msgid "Even though the method was always documented as a coroutine method, before Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an ``async def`` method."
msgstr "با وجود اینکه این متد همیشه بهعنوان یک متد همروال مستند شده بود، پیش از پایتون 3.7 یک :class:`Future` را برمیگرداند. از پایتون 3.7، این یک متد ``async def`` است."
msgid "Send a datagram from *sock* to *address*. Asynchronous version of :meth:`socket.sendto() <socket.socket.sendto>`."
msgstr "یک دیتاگرام را از *sock* به *address* ارسال میکند. نسخهی ناهمگام :meth:`socket.sendto() <socket.socket.sendto>`."
msgid "Return the number of bytes sent."
msgstr "تعداد بایتهای ارسالشده را برمیگرداند."
msgid "Connect *sock* to a remote socket at *address*."
msgstr "*sock* را به یک سوکت راه دور در *address* متصل میکند."
msgid "Asynchronous version of :meth:`socket.connect() <socket.socket.connect>`."
msgstr "نسخهی ناهمگام :meth:`socket.connect() <socket.socket.connect>`."
msgid "With :class:`SelectorEventLoop`, *address* does not need to be resolved: for :const:`~socket.AF_INET` and :const:`~socket.AF_INET6` sockets, ``sock_connect`` first checks whether *address* is already resolved by calling :func:`socket.inet_pton`, and uses :meth:`loop.getaddrinfo` to resolve it if it is not."
msgstr "در :class:`SelectorEventLoop`، نیازی نیست *address* ترجمه (resolve) شود: برای سوکتهای :const:`~socket.AF_INET` و :const:`~socket.AF_INET6`، ``sock_connect`` ابتدا با فراخوانی :func:`socket.inet_pton` بررسی میکند که آیا *address* از پیش حل شده است یا خیر، و اگر ترجمهشده نباشد، برای ترجمهی آن از :meth:`loop.getaddrinfo` استفاده میکند."
msgid ":class:`ProactorEventLoop`, the default event loop on Windows, does not resolve *address*. The host must already be a numeric IP address; passing a host name raises :exc:`OSError`. Resolve the address with :meth:`loop.getaddrinfo` first, or use :meth:`loop.create_connection`, which resolves the address on every platform."
msgstr ":class:`ProactorEventLoop`، حلقه رویداد پیشفرض در ویندوز، *نشانی* را حل نمیکند. میزبان باید از پیش یک نشانی IP عددی باشد؛ ارسال نام میزبان باعث پرتاب :exc:`OSError` میشود. ابتدا نشانی را با :meth:`loop.getaddrinfo` حل کنید، یا از :meth:`loop.create_connection` استفاده کنید، که نشانی را در همه پلتفرمها حل میکند."
msgid "With :class:`SelectorEventLoop`, ``address`` no longer needs to be resolved."
msgstr "با :class:`SelectorEventLoop`، دیگر نیازی به تعیین (resolve) ``address`` نیست."
msgid ":meth:`loop.create_connection` and :func:`asyncio.open_connection() <open_connection>`."
msgstr ":meth:`loop.create_connection` و :func:`asyncio.open_connection() <open_connection>`."
msgid "Accept a connection. Modeled after the blocking :meth:`socket.accept() <socket.socket.accept>` method."
msgstr "یک اتصال را میپذیرد. بر اساس متد مسدودکنندهی :meth:`socket.accept() <socket.socket.accept>` مدلسازی شده است."
msgid "The socket must be bound to an address and listening for connections. The return value is a pair ``(conn, address)`` where *conn* is a *new* socket object usable to send and receive data on the connection, and *address* is the address bound to the socket on the other end of the connection."
msgstr "سوکت باید به یک نشانی مقید شده باشد و در حال گوش دادن به اتصالها باشد. مقدار بازگشتی یک جفت ``(conn, address)`` است که در آن *conn* یک شیء سوکت *جدید* قابل استفاده برای ارسال و دریافت داده روی اتصال است، و *address* نشانی است که به سوکت در طرف دیگر اتصال مقید شده است."
msgid ":meth:`loop.create_server` and :func:`start_server`."
msgstr ":meth:`loop.create_server` و :func:`start_server`."
msgid "Send a file using high-performance :mod:`os.sendfile` if possible. Return the total number of bytes sent."
msgstr "در صورت امکان، یک پرونده را با استفاده از :mod:`os.sendfile` با کارایی بالا ارسال میکند. تعداد کل بایتهای ارسالشده را برمیگرداند."
msgid "Asynchronous version of :meth:`socket.sendfile() <socket.socket.sendfile>`."
msgstr "نسخهی ناهمگام از :meth:`socket.sendfile() <socket.socket.sendfile>`."
msgid "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket.socket`."
msgstr "*sock* باید یک :class:`~socket.socket` غیرمسدود از نوع :const:`socket.SOCK_STREAM` باشد."
msgid "*file* must be a regular file object open in binary mode."
msgstr "*file* باید یک شیء پرونده معمولی باشد که در حالت دودویی باز شده است."
msgid "*fallback*, when set to ``True``, makes asyncio manually read and send the file when the platform does not support the sendfile syscall (e.g. Windows or SSL socket on Unix)."
msgstr "*fallback*، وقتی روی ``True`` تنظیم شود، باعث میشود asyncio زمانی که سکو از فراخوانی سیستمی sendfile پشتیبانی نمیکند (مثلاً Windows یا سوکت SSL در Unix)، پرونده را بهصورت دستی بخواند و ارسال کند."
msgid "Raise :exc:`SendfileNotAvailableError` if the system does not support *sendfile* syscall and *fallback* is ``False``."
msgstr "اگر سیستم از فراخوانی سیستمی *sendfile* پشتیبانی نکند و *fallback* برابر ``False`` باشد، :exc:`SendfileNotAvailableError` پرتاب میشود."
msgid "DNS"
msgstr "DNS"
msgid "Asynchronous version of :meth:`socket.getaddrinfo`."
msgstr "نسخهی ناهمگام :meth:`socket.getaddrinfo`."
msgid "Asynchronous version of :meth:`socket.getnameinfo`."
msgstr "نسخهی ناهمگام :meth:`socket.getnameinfo`."
msgid "Both *getaddrinfo* and *getnameinfo* internally utilize their synchronous versions through the loop's default thread pool executor. When this executor is saturated, these methods may experience delays, which higher-level networking libraries may report as increased timeouts. To mitigate this, consider using a custom executor for other user tasks, or setting a default executor with a larger number of workers."
msgstr "هر دو *getaddrinfo* و *getnameinfo* بهصورت داخلی از نسخههای همگام خود از طریق اجراکنندهی استخر نخ پیشفرض حلقه (thread pool executor) استفاده میکنند. هنگامی که این اجراکننده اشباع شود، این متدها ممکن است با تأخیر مواجه شوند؛ کتابخانههای شبکهای سطح بالاتر ممکن است این تأخیرها را بهصورت افزایش مهلت زمانی گزارش کنند. برای کاهش این مشکل، استفاده از یک اجراکنندهی سفارشی برای سایر وظایف کاربر، یا تنظیم یک اجراکنندهی پیشفرض با تعداد بیشتری کارگر را در نظر بگیرید."
msgid "Both *getaddrinfo* and *getnameinfo* methods were always documented to return a coroutine, but prior to Python 3.7 they were, in fact, returning :class:`asyncio.Future` objects. Starting with Python 3.7 both methods are coroutines."
msgstr "در مستندات همواره آمده بود که هر دو متد *getaddrinfo* و *getnameinfo* یک همروال برمیگردانند، اما پیش از Python 3.7، آنها در واقع اشیای :class:`asyncio.Future` را برمیگرداندند. از Python 3.7 به بعد، هر دو متد همروال هستند."
msgid "Working with pipes"
msgstr "کار با پایپها"
msgid "Register the read end of *pipe* in the event loop."
msgstr "انتهای خواندن *pipe* را در حلقه رویداد ثبت کنید."
msgid "*pipe* is a :term:`file-like object <file object>`. See :ref:`Supported pipe objects <asyncio-pipe-objects>` for the objects supported as *pipe*."
msgstr "*pipe* یک :term:`شیء شبهپرونده <file object>` است. برای مشاهدهی اشیاء پشتیبانیشده بهعنوان *pipe*، :ref:`اشیای pipe پشتیبانیشده <asyncio-pipe-objects>` را ببینید."
msgid "Return pair ``(transport, protocol)``, where *transport* supports the :class:`ReadTransport` interface and *protocol* is an object instantiated by the *protocol_factory*."
msgstr "یک جفت ``(transport, protocol)`` را برمیگرداند، که در آن *transport* از رابط :class:`ReadTransport` پشتیبانی میکند و *protocol* شیءای است که *protocol_factory* آن را نمونهسازی کرده است."
msgid "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-blocking mode."
msgstr "در حلقه رویداد :class:`SelectorEventLoop`، *پایپ* به حالت غیرمسدودکننده تنظیم میشود."
msgid "Register the write end of *pipe* in the event loop."
msgstr "انتهای نوشتن *pipe* را در حلقه رویداد ثبت کنید."
msgid "Return pair ``(transport, protocol)``, where *transport* supports :class:`WriteTransport` interface and *protocol* is an object instantiated by the *protocol_factory*."
msgstr "یک جفت ``(transport, protocol)`` را برمیگرداند، که در آن *transport* از رابط :class:`WriteTransport` پشتیبانی میکند و *protocol* یک شیء نمونهسازیشده توسط *protocol_factory* است."
msgid "Supported pipe objects"
msgstr "اشیای pipe پشتیبانیشده"
msgid "These methods only work with objects the operating system can poll for readiness or perform overlapped I/O on. Regular files on disk are **not** supported on any platform. There is no asynchronous file I/O in asyncio; use :meth:`loop.run_in_executor` to read and write regular files without blocking the event loop."
msgstr "این متدها فقط با اشیایی کار میکنند که سیستمعامل بتواند آمادگی آنها را پایش کند یا روی آنها ورودی/خروجی همپوشانیشده (overlapped I/O) انجام دهد. از پروندههای معمولی روی دیسک در هیچ پلتفرمی پشتیبانی **نمیشود**. هیچ ورودی/خروجی ناهمگام پروندهای در asyncio وجود ندارد؛ برای خواندن و نوشتن پروندههای معمولی بدون مسدود کردن حلقه رویداد، از :meth:`loop.run_in_executor` استفاده کنید."
msgid "On Unix, with :class:`SelectorEventLoop`, *pipe* must wrap one of the following:"
msgstr "در یونیکس، با :class:`SelectorEventLoop`، *pipe* باید پوششی برای یکی از موارد زیر باشد:"
msgid "a pipe, such as an end of an :func:`os.pipe` pair or a FIFO created with :func:`os.mkfifo`;"
msgstr "یک پایپ، مانند یکی از سرهای یک جفت :func:`os.pipe` یا یک FIFO ایجادشده با :func:`os.mkfifo`؛"
msgid "a socket;"
msgstr "یک سوکت؛"
msgid "a character device, such as a terminal."
msgstr "یک دستگاه نویسهای، مانند یک پایانه."
msgid "On Windows, where only :class:`ProactorEventLoop` implements these methods, *pipe* must wrap a handle opened for overlapped I/O (that is, created with the ``FILE_FLAG_OVERLAPPED`` flag), since the handle has to be associated with an I/O completion port. Handles that were not opened for overlapped I/O are rejected. In particular, the standard streams (:data:`sys.stdin`, :data:`sys.stdout` and :data:`sys.stderr`), console handles, and the pipes created by :func:`os.pipe` are **not** opened for overlapped I/O and therefore cannot be used with these methods."
msgstr "در ویندوز، که تنها :class:`ProactorEventLoop` این متدها را پیادهسازی میکند، *pipe* باید یک دسته را که برای I/O همپوشانیشده (overlapped I/O) باز شده است (یعنی با پرچم ``FILE_FLAG_OVERLAPPED`` ایجاد شده است)، دربرگیرد، زیرا دسته باید به یک پورت تکمیل I/O (I/O completion port) مرتبط باشد. دستههایی که برای I/O همپوشانیشده باز نشدهاند، رد میشوند. بهویژه، جریانهای استاندارد (:data:`sys.stdin`، :data:`sys.stdout` و :data:`sys.stderr`)، دستههای کنسول و پایپهای ایجادشده توسط :func:`os.pipe` برای I/O همپوشانیشده باز **نشدهاند** و بنابراین نمیتوان از آنها با این متدها استفاده کرد."
msgid ":class:`SelectorEventLoop` does not support the above methods on Windows. Use :class:`ProactorEventLoop` instead for Windows."
msgstr ":class:`SelectorEventLoop` از متدهای بالا در ویندوز پشتیبانی نمیکند. در ویندوز، بهجای آن از :class:`ProactorEventLoop` استفاده کنید."
msgid "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods."
msgstr "متدهای :meth:`loop.subprocess_exec` و :meth:`loop.subprocess_shell`."
msgid "Unix signals"
msgstr "سیگنالهای یونیکس"
msgid "Set *callback* as the handler for the *signum* signal, passing *args* as positional arguments."
msgstr "*callback* را بهعنوان هندلر سیگنال *signum* تنظیم کنید و *args* را بهعنوان آرگومانهای جایگاهی ارسال کنید."
msgid "The callback will be invoked by *loop*, along with other queued callbacks and runnable coroutines of that event loop. Unlike signal handlers registered using :func:`signal.signal`, a callback registered with this function is allowed to interact with the event loop."
msgstr "کالبک توسط *loop*، همراه با سایر کالبکهای در صف و همروالهای قابل اجرا در آن حلقه رویداد، فراخوانی میشود. برخلاف هندلرهای سیگنال ثبتشده با استفاده از :func:`signal.signal`، کالبک ثبتشده با این تابع مجاز است با حلقه رویداد تعامل داشته باشد."
msgid "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. Raise :exc:`RuntimeError` if there is a problem setting up the handler."
msgstr "اگر شماره سیگنال نامعتبر یا غیرقابلدریافت باشد، :exc:`ValueError` پرتاب میشود. اگر در راهاندازی هندلر مشکلی وجود داشته باشد، :exc:`RuntimeError` پرتاب میشود."
msgid "Like :func:`signal.signal`, this function must be invoked in the main thread."
msgstr "مانند :func:`signal.signal`، این تابع باید در نخ اصلی فراخوانی شود."
msgid "Remove the handler for the *sig* signal."
msgstr "هندلر سیگنال *sig* را حذف کنید."
msgid "Return ``True`` if the signal handler was removed, or ``False`` if no handler was set for the given signal."
msgstr "اگر هندلر سیگنال حذف شده باشد، ``True`` را برمیگرداند، یا اگر برای سیگنال دادهشده هیچ هندلری تنظیم نشده باشد، ``False`` را برمیگرداند."
msgid "The :mod:`signal` module."
msgstr "ماژول :mod:`signal`."
msgid "Executing code in thread or process pools"
msgstr "اجرای کد در استخرهای نخ یا فرایند"
msgid "Arrange for *func* to be called in the specified executor passing *args* as positional arguments."
msgstr "ترتیبی دهید که *func* در اجراکنندهی مشخصشده (executor) با ارسال *args* بهعنوان آرگومانهای جایگاهی فراخوانی شود."
msgid "The *executor* argument should be an :class:`concurrent.futures.Executor` instance. The default executor is used if *executor* is ``None``. The default executor can be set by :meth:`loop.set_default_executor`, otherwise, a :class:`concurrent.futures.ThreadPoolExecutor` will be lazy-initialized and used by :func:`run_in_executor` if needed."
msgstr "آرگومان *executor* باید نمونهای از :class:`concurrent.futures.Executor` باشد. اگر *executor* برابر ``None`` باشد، از اجراکننده پیشفرض استفاده میشود. اجراکننده پیشفرض را میتوان با :meth:`loop.set_default_executor` تنظیم کرد؛ در غیر این صورت، یک :class:`concurrent.futures.ThreadPoolExecutor` بهصورت تنبل مقداردهی اولیه میشود و :func:`run_in_executor` در صورت نیاز از آن استفاده میکند."
msgid ""
"import asyncio\n"
"import concurrent.futures\n"
"\n"
"def blocking_io():\n"
" # File operations (such as logging) can block the\n"
" # event loop: run them in a thread pool.\n"
" with open('/dev/urandom', 'rb') as f:\n"
" return f.read(100)\n"
"\n"
"def cpu_bound():\n"
" # CPU-bound operations will block the event loop:\n"
" # in general it is preferable to run them in a\n"
" # process pool.\n"
" return sum(i * i for i in range(10 ** 7))\n"
"\n"
"async def main():\n"
" loop = asyncio.get_running_loop()\n"
"\n"
" ## Options:\n"
"\n"
" # 1. Run in the default loop's executor:\n"
" result = await loop.run_in_executor(\n"
" None, blocking_io)\n"
" print('default thread pool', result)\n"
"\n"
" # 2. Run in a custom thread pool:\n"
" with concurrent.futures.ThreadPoolExecutor() as pool:\n"
" result = await loop.run_in_executor(\n"
" pool, blocking_io)\n"
" print('custom thread pool', result)\n"
"\n"
" # 3. Run in a custom process pool:\n"
" with concurrent.futures.ProcessPoolExecutor() as pool:\n"
" result = await loop.run_in_executor(\n"
" pool, cpu_bound)\n"
" print('custom process pool', result)\n"
"\n"
" # 4. Run in a custom interpreter pool:\n"
" with concurrent.futures.InterpreterPoolExecutor() as pool:\n"
" result = await loop.run_in_executor(\n"
" pool, cpu_bound)\n"
" print('custom interpreter pool', result)\n"
"\n"
"if __name__ == '__main__':\n"
" asyncio.run(main())"
msgstr ""
"import asyncio\n"
"import concurrent.futures\n"
"\n"
"def blocking_io():\n"
" # File operations (such as logging) can block the\n"
" # event loop: run them in a thread pool.\n"
" with open('/dev/urandom', 'rb') as f:\n"
" return f.read(100)\n"
"\n"
"def cpu_bound():\n"
" # CPU-bound operations will block the event loop:\n"
" # in general it is preferable to run them in a\n"
" # process pool.\n"
" return sum(i * i for i in range(10 ** 7))\n"
"\n"
"async def main():\n"
" loop = asyncio.get_running_loop()\n"
"\n"
" ## Options:\n"
"\n"
" # 1. Run in the default loop's executor:\n"
" result = await loop.run_in_executor(\n"
" None, blocking_io)\n"
" print('default thread pool', result)\n"
"\n"
" # 2. Run in a custom thread pool:\n"
" with concurrent.futures.ThreadPoolExecutor() as pool:\n"
" result = await loop.run_in_executor(\n"
" pool, blocking_io)\n"
" print('custom thread pool', result)\n"
"\n"
" # 3. Run in a custom process pool:\n"
" with concurrent.futures.ProcessPoolExecutor() as pool:\n"
" result = await loop.run_in_executor(\n"
" pool, cpu_bound)\n"
" print('custom process pool', result)\n"
"\n"
" # 4. Run in a custom interpreter pool:\n"
" with concurrent.futures.InterpreterPoolExecutor() as pool:\n"
" result = await loop.run_in_executor(\n"
" pool, cpu_bound)\n"
" print('custom interpreter pool', result)\n"
"\n"
"if __name__ == '__main__':\n"
" asyncio.run(main())"
msgid "Note that the entry point guard (``if __name__ == '__main__'``) is required for option 3 due to the peculiarities of :mod:`multiprocessing`, which is used by :class:`~concurrent.futures.ProcessPoolExecutor`. See :ref:`Safe importing of main module <multiprocessing-safe-main-import>`."
msgstr "توجه داشته باشید که نگهبان نقطه ورود (``if __name__ == '__main__'``) به دلیل ویژگیهای خاص :mod:`multiprocessing`، که توسط :class:`~concurrent.futures.ProcessPoolExecutor` استفاده میشود، برای گزینهی ۳ لازم است. :ref:`ایمپورت امن ماژول اصلی <multiprocessing-safe-main-import>` را ببینید."
msgid "This method returns a :class:`asyncio.Future` object."
msgstr "این متد یک شیء :class:`asyncio.Future` را برمیگرداند."
msgid "Use :func:`functools.partial` :ref:`to pass keyword arguments <asyncio-pass-keywords>` to *func*."