-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathasyncio-sync.po
More file actions
500 lines (400 loc) · 28.1 KB
/
Copy pathasyncio-sync.po
File metadata and controls
500 lines (400 loc) · 28.1 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
# 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
# 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-13 19:37+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 "Synchronization Primitives"
msgstr "اولیههای همگامسازی"
msgid "**Source code:** :source:`Lib/asyncio/locks.py`"
msgstr "**کد منبع:** :source:`Lib/asyncio/locks.py`"
msgid "asyncio synchronization primitives are designed to be similar to those of the :mod:`threading` module with two important caveats:"
msgstr "اولیههای همگامسازی asyncio بهگونهای طراحی شدهاند که شبیه به همتاهای خود در ماژول :mod:`threading` باشند، با دو نکتهی مهم:"
msgid "asyncio primitives are not thread-safe, therefore they should not be used for OS thread synchronization (use :mod:`threading` for that);"
msgstr "اولیههای asyncio ایمن از نظر نخ (thread-safe) نیستند، بنابراین نباید برای همگامسازی نخهای سیستمعامل از آنها استفاده شود (برای این کار از :mod:`threading` استفاده کنید)؛"
msgid "methods of these synchronization primitives do not accept the *timeout* argument; use the :func:`asyncio.wait_for` function to perform operations with timeouts."
msgstr "متدهای این اولیههای همگامسازی آرگومان *timeout* را نمیپذیرند؛ برای انجام عملیات با مهلتهای زمانی از تابع :func:`asyncio.wait_for` استفاده کنید."
msgid "asyncio has the following basic synchronization primitives:"
msgstr "asyncio دارای اولیههای پایهی همگامسازی زیر است:"
msgid ":class:`Lock`"
msgstr ":class:`Lock`"
msgid ":class:`Event`"
msgstr ":class:`Event`"
msgid ":class:`Condition`"
msgstr ":class:`Condition`"
msgid ":class:`Semaphore`"
msgstr ":class:`Semaphore`"
msgid ":class:`BoundedSemaphore`"
msgstr ":class:`BoundedSemaphore`"
msgid ":class:`Barrier`"
msgstr ":class:`Barrier`"
msgid "Lock"
msgstr "قفل"
msgid "Implements a mutex lock for asyncio tasks. Not thread-safe."
msgstr "یک قفل متقابل (mutex lock) برای وظایف asyncio پیادهسازی میکند. ایمن از نظر نخ (thread-safe) نیست."
msgid "An asyncio lock can be used to guarantee exclusive access to a shared resource."
msgstr "میتوان از یک قفل asyncio برای تضمین دسترسی انحصاری به یک منبع مشترک استفاده کرد."
msgid "The preferred way to use a Lock is an :keyword:`async with` statement::"
msgstr "روش ترجیحی برای استفاده از Lock، دستور :keyword:`async with` است::"
msgid ""
"lock = asyncio.Lock()\n"
"\n"
"# ... later\n"
"async with lock:\n"
" # access shared state"
msgstr ""
"lock = asyncio.Lock()\n"
"\n"
"# ... later\n"
"async with lock:\n"
" # access shared state"
msgid "which is equivalent to::"
msgstr "که معادل زیر است::"
msgid ""
"lock = asyncio.Lock()\n"
"\n"
"# ... later\n"
"await lock.acquire()\n"
"try:\n"
" # access shared state\n"
"finally:\n"
" lock.release()"
msgstr ""
"lock = asyncio.Lock()\n"
"\n"
"# ... later\n"
"await lock.acquire()\n"
"try:\n"
" # access shared state\n"
"finally:\n"
" lock.release()"
msgid "Removed the *loop* parameter."
msgstr "پارامتر *loop* حذف شد."
msgid "Acquire the lock."
msgstr "قفل را کسب کنید."
msgid "This method waits until the lock is *unlocked*, sets it to *locked* and returns ``True``."
msgstr "این متد منتظر میماند تا قفل *باز* شود، آن را *قفل* میکند و ``True`` را برمیگرداند."
msgid "When more than one coroutine is blocked in :meth:`acquire` waiting for the lock to be unlocked, only one coroutine eventually proceeds."
msgstr "هنگامی که بیش از یک همروال در :meth:`acquire` مسدود شده باشد و منتظر باز شدن قفل باشد، در نهایت تنها یک همروال ادامه پیدا میکند."
msgid "Acquiring a lock is *fair*: the coroutine that proceeds will be the first coroutine that started waiting on the lock."
msgstr "کسب قفل *منصفانه* است: همروالی که ادامه میدهد، نخستین همروالی خواهد بود که منتظر قفل شده است."
msgid "Release the lock."
msgstr "قفل را آزاد کنید."
msgid "When the lock is *locked*, reset it to *unlocked* and return."
msgstr "هنگامی که قفل *قفلشده* است، آن را به *باز* بازنشانی کنید و بازگردید."
msgid "If the lock is *unlocked*, a :exc:`RuntimeError` is raised."
msgstr "اگر قفل *باز* باشد، یک :exc:`RuntimeError` پرتاب میشود."
msgid "Return ``True`` if the lock is *locked*."
msgstr "اگر قفل *قفلشده* باشد، ``True`` را برمیگرداند."
msgid "Event"
msgstr "رویداد"
msgid "An event object. Not thread-safe."
msgstr "یک شیء رویداد. نخایمن نیست."
msgid "An asyncio event can be used to notify multiple asyncio tasks that some event has happened."
msgstr "میتوان از یک رویداد asyncio برای آگاهسازی چندین وظیفه در asyncio از وقوع رویدادی استفاده کرد."
msgid "An Event object manages an internal flag that can be set to *true* with the :meth:`~Event.set` method and reset to *false* with the :meth:`clear` method. The :meth:`~Event.wait` method blocks until the flag is set to *true*. The flag is set to *false* initially."
msgstr "یک شیء Event یک پرچم داخلی را مدیریت میکند که میتوان آن را با متد :meth:`~Event.set` روی *true* تنظیم کرد و با متد :meth:`clear` به *false* بازنشانی کرد. متد :meth:`~Event.wait` تا زمانی که پرچم روی *true* تنظیم شود، مسدود میشود. پرچم در ابتدا روی *false* تنظیم شده است."
msgid "Example::"
msgstr "مثال::"
msgid ""
"async def waiter(event):\n"
" print('waiting for it ...')\n"
" await event.wait()\n"
" print('... got it!')\n"
"\n"
"async def main():\n"
" # Create an Event object.\n"
" event = asyncio.Event()\n"
"\n"
" # Spawn a Task to wait until 'event' is set.\n"
" waiter_task = asyncio.create_task(waiter(event))\n"
"\n"
" # Sleep for 1 second and set the event.\n"
" await asyncio.sleep(1)\n"
" event.set()\n"
"\n"
" # Wait until the waiter task is finished.\n"
" await waiter_task\n"
"\n"
"asyncio.run(main())"
msgstr ""
"async def waiter(event):\n"
" print('waiting for it ...')\n"
" await event.wait()\n"
" print('... got it!')\n"
"\n"
"async def main():\n"
" # Create an Event object.\n"
" event = asyncio.Event()\n"
"\n"
" # Spawn a Task to wait until 'event' is set.\n"
" waiter_task = asyncio.create_task(waiter(event))\n"
"\n"
" # Sleep for 1 second and set the event.\n"
" await asyncio.sleep(1)\n"
" event.set()\n"
"\n"
" # Wait until the waiter task is finished.\n"
" await waiter_task\n"
"\n"
"asyncio.run(main())"
msgid "Wait until the event is set."
msgstr "صبر کنید تا رویداد تنظیم شود."
msgid "If the event is set, return ``True`` immediately. Otherwise block until another task calls :meth:`~Event.set`."
msgstr "اگر رویداد تنظیمشده باشد، بلافاصله ``True`` را برمیگرداند. در غیر این صورت، تا زمانی که وظیفه دیگری :meth:`~Event.set` را فراخوانی کند، مسدود میشود."
msgid "Set the event."
msgstr "رویداد را تنظیم کنید."
msgid "All tasks waiting for event to be set will be immediately awakened."
msgstr "همهی وظایفی که در انتظار تنظیم شدن رویداد هستند، بیدرنگ بیدار خواهند شد."
msgid "Clear (unset) the event."
msgstr "رویداد را پاک (لغو تنظیم) میکند."
msgid "Subsequent tasks awaiting on :meth:`~Event.wait` will now block until the :meth:`~Event.set` method is called again."
msgstr "وظایف بعدی که :meth:`~Event.wait` را await میکنند، اکنون تا زمانی که متد :meth:`~Event.set` دوباره فراخوانی شود، مسدود خواهند شد."
msgid "Return ``True`` if the event is set."
msgstr "اگر رویداد تنظیمشده باشد، ``True`` را برمیگرداند."
msgid "Condition"
msgstr "شرایط"
msgid "A Condition object. Not thread-safe."
msgstr "یک شیء Condition. ایمن از نظر نخ نیست."
msgid "An asyncio condition primitive can be used by a task to wait for some event to happen and then get exclusive access to a shared resource."
msgstr "یک وظیفه میتواند از یک سازوکار شرطی اولیه در asyncio استفاده کند تا برای رخ دادن رویدادی منتظر بماند و سپس دسترسی انحصاری به یک منبع مشترک را بهدست آورد."
msgid "In essence, a Condition object combines the functionality of an :class:`Event` and a :class:`Lock`. It is possible to have multiple Condition objects share one Lock, which allows coordinating exclusive access to a shared resource between different tasks interested in particular states of that shared resource."
msgstr "در اصل، یک شیء Condition، کارکرد :class:`Event` و :class:`Lock` را ترکیب میکند. میتوان چندین شیء Condition داشت که یک Lock را به اشتراک میگذارند؛ این امکان، هماهنگسازی دسترسی انحصاری به یک منبع مشترک را بین وظایف مختلفی که به وضعیتهای خاصی از آن منبع مشترک علاقهمند هستند، ممکن میسازد."
msgid "The optional *lock* argument must be a :class:`Lock` object or ``None``. In the latter case a new Lock object is created automatically."
msgstr "آرگومان اختیاری *lock* باید یک شیء :class:`Lock` یا ``None`` باشد. در حالت دوم، یک شیء Lock جدید بهصورت خودکار ایجاد میشود."
msgid "The preferred way to use a Condition is an :keyword:`async with` statement::"
msgstr "روش ترجیحدادهشده برای استفاده از Condition، دستور :keyword:`async with` است::"
msgid ""
"cond = asyncio.Condition()\n"
"\n"
"# ... later\n"
"async with cond:\n"
" await cond.wait()"
msgstr ""
"cond = asyncio.Condition()\n"
"\n"
"# ... later\n"
"async with cond:\n"
" await cond.wait()"
msgid ""
"cond = asyncio.Condition()\n"
"\n"
"# ... later\n"
"await cond.acquire()\n"
"try:\n"
" await cond.wait()\n"
"finally:\n"
" cond.release()"
msgstr ""
"cond = asyncio.Condition()\n"
"\n"
"# ... later\n"
"await cond.acquire()\n"
"try:\n"
" await cond.wait()\n"
"finally:\n"
" cond.release()"
msgid "Acquire the underlying lock."
msgstr "قفل زیربنایی را تصاحب کنید."
msgid "This method waits until the underlying lock is *unlocked*, sets it to *locked* and returns ``True``."
msgstr "این متد تا زمانی که قفل زیربنایی *آزاد* شود صبر میکند، آن را در حالت *قفلشده* قرار میدهد و ``True`` را برمیگرداند."
msgid "Wake up *n* tasks (1 by default) waiting on this condition. If fewer than *n* tasks are waiting they are all awakened."
msgstr "بیدار کردن *n* وظیفه در انتظار این شرط (بهطور پیشفرض ۱). اگر کمتر از *n* وظیفه در انتظار باشند، همهی آنها بیدار میشوند."
msgid "The lock must be acquired before this method is called and released shortly after. If called with an *unlocked* lock a :exc:`RuntimeError` error is raised."
msgstr "قفل باید پیش از فراخوانی این متد کسب شود و اندکی پس از آن آزاد شود. اگر با یک قفل *باز* فراخوانی شود، خطای :exc:`RuntimeError` پرتاب میشود."
msgid "Return ``True`` if the underlying lock is acquired."
msgstr "اگر قفل زیربنایی کسب شده باشد، ``True`` برمیگرداند."
msgid "Wake up all tasks waiting on this condition."
msgstr "تمام وظایف در انتظار این شرط را بیدار کنید."
msgid "This method acts like :meth:`notify`, but wakes up all waiting tasks."
msgstr "این متد مانند :meth:`notify` عمل میکند، اما تمام وظایف در انتظار را بیدار میکند."
msgid "Release the underlying lock."
msgstr "قفل زیربنایی را آزاد کنید."
msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised."
msgstr "هنگامی که روی یک قفل باز فراخوانی شود، یک :exc:`RuntimeError` پرتاب میشود."
msgid "Wait until notified."
msgstr "تا زمانی که به شما اطلاع داده شود، صبر کنید."
msgid "If the calling task has not acquired the lock when this method is called, a :exc:`RuntimeError` is raised."
msgstr "اگر در زمان فراخوانی این متد، وظیفه فراخوانیکننده قفل را به دست نیاورده باشد، یک :exc:`RuntimeError` پرتاب میشود."
msgid "This method releases the underlying lock, and then blocks until it is awakened by a :meth:`notify` or :meth:`notify_all` call. Once awakened, the Condition re-acquires its lock and this method returns ``True``."
msgstr "این متد قفل زیربنایی را آزاد میکند و سپس تا زمانی که با فراخوانی :meth:`notify` یا :meth:`notify_all` بیدار شود، مسدود میشود. پس از بیدار شدن، Condition قفل خود را دوباره به دست میآورد و این متد ``True`` را برمیگرداند."
msgid "Note that a task *may* return from this call spuriously, which is why the caller should always re-check the state and be prepared to :meth:`~Condition.wait` again. For this reason, you may prefer to use :meth:`~Condition.wait_for` instead."
msgstr "توجه داشته باشید که یک وظیفه *ممکن است* بهصورت کاذب از این فراخوانی بازگردد، به همین دلیل فراخواننده باید همیشه وضعیت را دوباره بررسی کند و برای فراخوانی دوبارهی :meth:`~Condition.wait` آماده باشد. به همین دلیل، ممکن است ترجیح دهید بهجای آن از :meth:`~Condition.wait_for` استفاده کنید."
msgid "Wait until a predicate becomes *true*."
msgstr "صبر کنید تا یک محمول (predicate) به مقدار *درست* برسد."
msgid "The predicate must be a callable which result will be interpreted as a boolean value. The method will repeatedly :meth:`~Condition.wait` until the predicate evaluates to *true*. The final value is the return value."
msgstr "محمول باید یک شیء فراخوانیپذیر باشد که نتیجهی آن بهعنوان یک مقدار بولی تفسیر میشود. این متد بهطور مکرر :meth:`~Condition.wait` را فراخوانی میکند، تا زمانی که محمول بهمقدار *true* ارزیابی شود. مقدار نهایی همان مقدار بازگشتی است."
msgid "Semaphore"
msgstr "سمافور"
msgid "A Semaphore object. Not thread-safe."
msgstr "یک شیء Semaphore. نخایمن نیست."
msgid "A semaphore manages an internal counter which is decremented by each :meth:`acquire` call and incremented by each :meth:`release` call. The counter can never go below zero; when :meth:`acquire` finds that it is zero, it blocks, waiting until some task calls :meth:`release`."
msgstr "سمافور یک شمارندهی داخلی را مدیریت میکند که با هر فراخوانی :meth:`acquire` کاهش مییابد و با هر فراخوانی :meth:`release` افزایش مییابد. شمارنده هرگز نمیتواند زیر صفر برود؛ هنگامی که :meth:`acquire` ببیند که شمارنده صفر است، مسدود میشود و منتظر میماند تا وظیفهی :meth:`release` را فراخوانی کند."
msgid "The optional *value* argument gives the initial value for the internal counter (``1`` by default). If the given value is less than ``0`` a :exc:`ValueError` is raised."
msgstr "آرگومان اختیاری *value* مقدار اولیه شمارنده داخلی را مشخص میکند (بهطور پیشفرض ``1``). اگر مقدار دادهشده کمتر از ``0`` باشد، یک :exc:`ValueError` پرتاب میشود."
msgid "The preferred way to use a Semaphore is an :keyword:`async with` statement::"
msgstr "روش ترجیحی برای استفاده از Semaphore، استفاده از یک دستور :keyword:`async with` است::"
msgid ""
"sem = asyncio.Semaphore(10)\n"
"\n"
"# ... later\n"
"async with sem:\n"
" # work with shared resource"
msgstr ""
"sem = asyncio.Semaphore(10)\n"
"\n"
"# ... later\n"
"async with sem:\n"
" # work with shared resource"
msgid ""
"sem = asyncio.Semaphore(10)\n"
"\n"
"# ... later\n"
"await sem.acquire()\n"
"try:\n"
" # work with shared resource\n"
"finally:\n"
" sem.release()"
msgstr ""
"sem = asyncio.Semaphore(10)\n"
"\n"
"# ... later\n"
"await sem.acquire()\n"
"try:\n"
" # work with shared resource\n"
"finally:\n"
" sem.release()"
msgid "Acquire a semaphore."
msgstr "یک سمافور را تصاحب کنید."
msgid "If the internal counter is greater than zero, decrement it by one and return ``True`` immediately. If it is zero, wait until a :meth:`release` is called and return ``True``."
msgstr "اگر شمارندهی داخلی بزرگتر از صفر باشد، آن را یک واحد کاهش دهید و بلافاصله ``True`` را برگردانید. اگر صفر باشد، منتظر بمانید تا :meth:`release` فراخوانی شود و ``True`` را برگردانید."
msgid "Returns ``True`` if semaphore can not be acquired immediately."
msgstr "اگر سمافور نتواند بلافاصله کسب شود، ``True`` را برمیگرداند."
msgid "Release a semaphore, incrementing the internal counter by one. Can wake up a task waiting to acquire the semaphore."
msgstr "یک سمافور را آزاد میکند و شمارندهی داخلی را ۱ واحد افزایش میدهد. میتواند وظیفهای را که در انتظار بهدست آوردن سمافور است بیدار کند."
msgid "Unlike :class:`BoundedSemaphore`, :class:`Semaphore` allows making more ``release()`` calls than ``acquire()`` calls."
msgstr "برخلاف :class:`BoundedSemaphore`، :class:`Semaphore` اجازه میدهد فراخوانیهای ``release()`` بیشتری نسبت به فراخوانیهای ``acquire()`` انجام شود."
msgid "BoundedSemaphore"
msgstr "BoundedSemaphore"
msgid "A bounded semaphore object. Not thread-safe."
msgstr "یک شیء سمافور کراندار. نخایمن نیست."
msgid "Bounded Semaphore is a version of :class:`Semaphore` that raises a :exc:`ValueError` in :meth:`~Semaphore.release` if it increases the internal counter above the initial *value*."
msgstr "سمافور محدود (Bounded Semaphore) نسخهای از :class:`Semaphore` است که در :meth:`~Semaphore.release`، اگر شمارنده داخلی را به بالاتر از *value* اولیه افزایش دهد، :exc:`ValueError` پرتاب میکند."
msgid "Barrier"
msgstr "سد"
msgid "A barrier object. Not thread-safe."
msgstr "یک شیء سد (barrier). نخایمن نیست."
msgid "A barrier is a simple synchronization primitive that allows to block until *parties* number of tasks are waiting on it. Tasks can wait on the :meth:`~Barrier.wait` method and would be blocked until the specified number of tasks end up waiting on :meth:`~Barrier.wait`. At that point all of the waiting tasks would unblock simultaneously."
msgstr "یک سد، یک ساختار اولیه همگامسازی ساده است که امکان مسدود شدن تا زمانی که تعداد *parties* وظیفه منتظر آن باشند را فراهم میکند. وظایف میتوانند با متد :meth:`~Barrier.wait` منتظر بمانند و تا زمانی که تعداد مشخصشدهای از وظایف در نهایت با متد :meth:`~Barrier.wait` منتظر شوند، مسدود میمانند. در آن نقطه، همه وظایف منتظر بهطور همزمان از حالت مسدود خارج میشوند."
msgid ":keyword:`async with` can be used as an alternative to awaiting on :meth:`~Barrier.wait`."
msgstr ":keyword:`async with` میتواند بهعنوان جایگزینی برای await روی :meth:`~Barrier.wait` استفاده شود."
msgid "The barrier can be reused any number of times."
msgstr "این سد را میتوان هر تعداد باری دوباره استفاده کرد."
msgid ""
"async def example_barrier():\n"
" # barrier with 3 parties\n"
" b = asyncio.Barrier(3)\n"
"\n"
" # create 2 new waiting tasks\n"
" asyncio.create_task(b.wait())\n"
" asyncio.create_task(b.wait())\n"
"\n"
" await asyncio.sleep(0)\n"
" print(b)\n"
"\n"
" # The third .wait() call passes the barrier\n"
" await b.wait()\n"
" print(b)\n"
" print(\"barrier passed\")\n"
"\n"
" await asyncio.sleep(0)\n"
" print(b)\n"
"\n"
"asyncio.run(example_barrier())"
msgstr ""
"async def example_barrier():\n"
" # barrier with 3 parties\n"
" b = asyncio.Barrier(3)\n"
"\n"
" # create 2 new waiting tasks\n"
" asyncio.create_task(b.wait())\n"
" asyncio.create_task(b.wait())\n"
"\n"
" await asyncio.sleep(0)\n"
" print(b)\n"
"\n"
" # The third .wait() call passes the barrier\n"
" await b.wait()\n"
" print(b)\n"
" print(\"barrier passed\")\n"
"\n"
" await asyncio.sleep(0)\n"
" print(b)\n"
"\n"
"asyncio.run(example_barrier())"
msgid "Result of this example is::"
msgstr "نتیجهی این مثال::"
msgid ""
"<asyncio.locks.Barrier object at 0x... [filling, waiters:2/3]>\n"
"<asyncio.locks.Barrier object at 0x... [draining, waiters:0/3]>\n"
"barrier passed\n"
"<asyncio.locks.Barrier object at 0x... [filling, waiters:0/3]>"
msgstr ""
"<asyncio.locks.Barrier object at 0x... [filling, waiters:2/3]>\n"
"<asyncio.locks.Barrier object at 0x... [draining, waiters:0/3]>\n"
"barrier passed\n"
"<asyncio.locks.Barrier object at 0x... [filling, waiters:0/3]>"
msgid "Pass the barrier. When all the tasks party to the barrier have called this function, they are all unblocked simultaneously."
msgstr "از سد عبور کنید. هنگامی که همه وظایف شرکتکننده در سد این تابع را فراخوانی کرده باشند، همه آنها بهطور همزمان رفع انسداد میشوند."
msgid "When a waiting or blocked task in the barrier is cancelled, this task exits the barrier which stays in the same state. If the state of the barrier is \"filling\", the number of waiting task decreases by 1."
msgstr "هنگامی که یک وظیفهی در انتظار یا مسدودشده در سد لغو شود، این وظیفه از سد خارج میشود و سد در همان وضعیت باقی میماند. اگر وضعیت سد «در حال پر شدن» باشد، تعداد وظایف در انتظار به میزان ۱ کاهش مییابد."
msgid "The return value is an integer in the range of 0 to ``parties-1``, different for each task. This can be used to select a task to do some special housekeeping, e.g.::"
msgstr "مقدار بازگشتی یک عدد صحیح در بازهی ۰ تا ``parties-1`` است و برای هر وظیفه متفاوت است. میتوان از این مقدار برای انتخاب یک وظیفه جهت انجام برخی عملیات نگهداری خاص استفاده کرد، برای مثال::"
msgid ""
"...\n"
"async with barrier as position:\n"
" if position == 0:\n"
" # Only one task prints this\n"
" print('End of *draining phase*')"
msgstr ""
"...\n"
"async with barrier as position:\n"
" if position == 0:\n"
" # Only one task prints this\n"
" print('End of *draining phase*')"
msgid "This method may raise a :class:`BrokenBarrierError` exception if the barrier is broken or reset while a task is waiting. It could raise a :exc:`CancelledError` if a task is cancelled."
msgstr "این متد ممکن است در صورتی که سد در حین انتظار یک وظیفه شکسته شود یا بازنشانی شود، استثنای :class:`BrokenBarrierError` را پرتاب کند. ممکن است در صورت لغو شدن یک وظیفه، استثنای :exc:`CancelledError` را پرتاب کند."
msgid "Return the barrier to the default, empty state. Any tasks waiting on it will receive the :class:`BrokenBarrierError` exception."
msgstr "سد را به حالت پیشفرض و خالی بازمیگرداند. هر وظیفهی که در انتظار آن باشد، استثنای :class:`BrokenBarrierError` را دریافت خواهد کرد."
msgid "If a barrier is broken it may be better to just leave it and create a new one."
msgstr "اگر یک سد (barrier) شکسته شود، ممکن است بهتر باشد آن را به حال خود رها کنید و یک سد جدید ایجاد کنید."
msgid "Put the barrier into a broken state. This causes any active or future calls to :meth:`~Barrier.wait` to fail with the :class:`BrokenBarrierError`. Use this for example if one of the tasks needs to abort, to avoid infinite waiting tasks."
msgstr "سد (Barrier) را در وضعیت شکسته قرار دهید. این کار باعث میشود هر فراخوانی فعال یا آینده به :meth:`~Barrier.wait` با :class:`BrokenBarrierError` ناموفق شود. برای مثال، اگر یکی از وظایف نیاز به لغو شدن داشته باشد، از این استفاده کنید تا از وظایفی که بهطور بیپایان در انتظار میمانند جلوگیری شود."
msgid "The number of tasks required to pass the barrier."
msgstr "تعداد وظایف لازم برای عبور از سد."
msgid "The number of tasks currently waiting in the barrier while filling."
msgstr "تعداد وظایفی که در حال حاضر در حین پر شدن سد (barrier) منتظر هستند."
msgid "A boolean that is ``True`` if the barrier is in the broken state."
msgstr "یک بولی که اگر سد در وضعیت شکسته باشد، ``True`` است."
msgid "This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:`Barrier` object is reset or broken."
msgstr "این استثنا، که زیرکلاسی از :exc:`RuntimeError` است، زمانی پرتاب میشود که شیء :class:`Barrier` بازنشانی یا شکسته شود."
msgid "Acquiring a lock using ``await lock`` or ``yield from lock`` and/or :keyword:`with` statement (``with await lock``, ``with (yield from lock)``) was removed. Use ``async with lock`` instead."
msgstr "کسب قفل با استفاده از ``await lock`` یا ``yield from lock`` و/یا دستور :keyword:`with` (``with await lock``، ``with (yield from lock)``) حذف شده است. به جای آن از ``async with lock`` استفاده کنید."