@@ -74,9 +74,8 @@ msgid ":class:`BoundedSemaphore`"
74
74
msgstr ":class:`BoundedSemaphore`"
75
75
76
76
#: ../../library/asyncio-sync.rst:31
77
- #, fuzzy
78
77
msgid ":class:`Barrier`"
79
- msgstr ":class:`Event `"
78
+ msgstr ":class:`Barrier `"
80
79
81
80
#: ../../library/asyncio-sync.rst:38
82
81
msgid "Lock"
@@ -104,6 +103,11 @@ msgid ""
104
103
"async with lock:\n"
105
104
" # access shared state"
106
105
msgstr ""
106
+ "lock = asyncio.Lock()\n"
107
+ "\n"
108
+ "# ... 나중에\n"
109
+ "async with lock:\n"
110
+ " # 공유 상태를 액세스합니다"
107
111
108
112
#: ../../library/asyncio-sync.rst:56 ../../library/asyncio-sync.rst:201
109
113
#: ../../library/asyncio-sync.rst:309
@@ -121,13 +125,20 @@ msgid ""
121
125
"finally:\n"
122
126
" lock.release()"
123
127
msgstr ""
128
+ "lock = asyncio.Lock()\n"
129
+ "\n"
130
+ "# ... 나중에\n"
131
+ "await lock.acquire()\n"
132
+ "try:\n"
133
+ " # 공유 상태를 액세스합니다\n"
134
+ "finally:\n"
135
+ " lock.release()"
124
136
125
137
#: ../../library/asyncio-sync.rst:67 ../../library/asyncio-sync.rst:113
126
138
#: ../../library/asyncio-sync.rst:189 ../../library/asyncio-sync.rst:297
127
139
#: ../../library/asyncio-sync.rst:353
128
- #, fuzzy
129
140
msgid "Removed the *loop* parameter."
130
- msgstr "*loop* 매개 변수 "
141
+ msgstr "*loop* 매개 변수를 제거했습니다. "
131
142
132
143
#: ../../library/asyncio-sync.rst:73
133
144
msgid "Acquire the lock."
@@ -221,6 +232,26 @@ msgid ""
221
232
"\n"
222
233
"asyncio.run(main())"
223
234
msgstr ""
235
+ "async def waiter(event):\n"
236
+ " print('waiting for it ...')\n"
237
+ " await event.wait()\n"
238
+ " print('... got it!')\n"
239
+ "\n"
240
+ "async def main():\n"
241
+ " # Event 객체를 만듭니다.\n"
242
+ " event = asyncio.Event()\n"
243
+ "\n"
244
+ " # 'event'가 설정될 때까지 대기 할 Task를 만듭니다.\n"
245
+ " waiter_task = asyncio.create_task(waiter(event))\n"
246
+ "\n"
247
+ " # 1초 동안 잠잔 후에 event를 설정합니다.\n"
248
+ " await asyncio.sleep(1)\n"
249
+ " event.set()\n"
250
+ "\n"
251
+ " # waiter 태스크가 끝날 때까지 기다립니다.\n"
252
+ " await waiter_task\n"
253
+ "\n"
254
+ "asyncio.run(main())"
224
255
225
256
#: ../../library/asyncio-sync.rst:144
226
257
msgid "Wait until the event is set."
@@ -308,6 +339,11 @@ msgid ""
308
339
"async with cond:\n"
309
340
" await cond.wait()"
310
341
msgstr ""
342
+ "cond = asyncio.Condition()\n"
343
+ "\n"
344
+ "# ... 나중에\n"
345
+ "async with cond:\n"
346
+ " await cond.wait()"
311
347
312
348
#: ../../library/asyncio-sync.rst:203
313
349
msgid ""
@@ -320,6 +356,14 @@ msgid ""
320
356
"finally:\n"
321
357
" cond.release()"
322
358
msgstr ""
359
+ "cond = asyncio.Condition()\n"
360
+ "\n"
361
+ "# ... 나중에\n"
362
+ "await cond.acquire()\n"
363
+ "try:\n"
364
+ " await cond.wait()\n"
365
+ "finally:\n"
366
+ " cond.release()"
323
367
324
368
#: ../../library/asyncio-sync.rst:215
325
369
msgid "Acquire the underlying lock."
@@ -334,11 +378,10 @@ msgstr ""
334
378
"``True``\\ 를 반환합니다."
335
379
336
380
#: ../../library/asyncio-sync.rst:222
337
- #, fuzzy
338
381
msgid ""
339
382
"Wake up *n* tasks (1 by default) waiting on this condition. If fewer "
340
383
"than *n* tasks are waiting they are all awakened."
341
- msgstr "이 조건을 기다리는 최대 *n* 태스크(기본적으로 1개)를 깨웁니다. 대기 중인 태스크가 없으면 이 메서드는 no-op입니다 ."
384
+ msgstr "이 조건을 기다리는 *n* 태스크(기본적으로 1개)를 깨웁니다. 대기 중인 태스크가 *n* 개 보다 작으면 모두 깨어납니다 ."
342
385
343
386
#: ../../library/asyncio-sync.rst:225 ../../library/asyncio-sync.rst:240
344
387
msgid ""
@@ -401,12 +444,13 @@ msgid "Wait until a predicate becomes *true*."
401
444
msgstr "predicate가 *참*\\ 이 될 때까지 기다립니다."
402
445
403
446
#: ../../library/asyncio-sync.rst:274
404
- #, fuzzy
405
447
msgid ""
406
448
"The predicate must be a callable which result will be interpreted as a "
407
449
"boolean value. The method will repeatedly :meth:`~Condition.wait` until "
408
450
"the predicate evaluates to *true*. The final value is the return value."
409
- msgstr "predicate는 논릿값으로 해석될 결과를 돌려주는 콜러블이어야 합니다. 최종값이 반환 값입니다."
451
+ msgstr ""
452
+ "predicate는 논릿값으로 해석될 결과를 돌려주는 콜러블이어야 합니다. 메서드는 predicate가 *참*\\ 으로 평가될 때까지"
453
+ " 반복적으로 :meth:`~Condition.wait`\\ 합니다. 최종값이 반환 값입니다."
410
454
411
455
#: ../../library/asyncio-sync.rst:281
412
456
msgid "Semaphore"
@@ -450,6 +494,11 @@ msgid ""
450
494
"async with sem:\n"
451
495
" # work with shared resource"
452
496
msgstr ""
497
+ "sem = asyncio.Semaphore(10)\n"
498
+ "\n"
499
+ "# ... 나중에\n"
500
+ "async with sem:\n"
501
+ " # 공유 자원으로 작업합니다"
453
502
454
503
#: ../../library/asyncio-sync.rst:311
455
504
msgid ""
@@ -462,6 +511,14 @@ msgid ""
462
511
"finally:\n"
463
512
" sem.release()"
464
513
msgstr ""
514
+ "sem = asyncio.Semaphore(10)\n"
515
+ "\n"
516
+ "# ... 나중에\n"
517
+ "await sem.acquire()\n"
518
+ "try:\n"
519
+ " # 공유 자원으로 작업합니다\n"
520
+ "finally:\n"
521
+ " sem.release()"
465
522
466
523
#: ../../library/asyncio-sync.rst:323
467
524
msgid "Acquire a semaphore."
@@ -513,12 +570,11 @@ msgstr ""
513
570
514
571
#: ../../library/asyncio-sync.rst:358
515
572
msgid "Barrier"
516
- msgstr ""
573
+ msgstr "Barrier "
517
574
518
575
#: ../../library/asyncio-sync.rst:362
519
- #, fuzzy
520
576
msgid "A barrier object. Not thread-safe."
521
- msgstr "이벤트 객체. 스레드 안전하지 않습니다."
577
+ msgstr "장벽 객체. 스레드 안전하지 않습니다."
522
578
523
579
#: ../../library/asyncio-sync.rst:364
524
580
msgid ""
@@ -562,6 +618,26 @@ msgid ""
562
618
"\n"
563
619
"asyncio.run(example_barrier())"
564
620
msgstr ""
621
+ "async def example_barrier():\n"
622
+ " # 3자 간 장벽\n"
623
+ " b = asyncio.Barrier(3)\n"
624
+ "\n"
625
+ " # 기다리는 태스크를 2개 만듭니다\n"
626
+ " asyncio.create_task(b.wait())\n"
627
+ " asyncio.create_task(b.wait())\n"
628
+ "\n"
629
+ " await asyncio.sleep(0)\n"
630
+ " print(b)\n"
631
+ "\n"
632
+ " # 세 번째 .wait() 호출은 장벽을 통과합니다\n"
633
+ " await b.wait()\n"
634
+ " print(b)\n"
635
+ " print(\" barrier passed\" )\n"
636
+ "\n"
637
+ " await asyncio.sleep(0)\n"
638
+ " print(b)\n"
639
+ "\n"
640
+ "asyncio.run(example_barrier())"
565
641
566
642
#: ../../library/asyncio-sync.rst:400
567
643
msgid "Result of this example is::"
@@ -574,6 +650,10 @@ msgid ""
574
650
"barrier passed\n"
575
651
"<asyncio.locks.Barrier object at 0x... [filling, waiters:0/3]>"
576
652
msgstr ""
653
+ "<asyncio.locks.Barrier object at 0x... [filling, waiters:2/3]>\n"
654
+ "<asyncio.locks.Barrier object at 0x... [draining, waiters:0/3]>\n"
655
+ "barrier passed\n"
656
+ "<asyncio.locks.Barrier object at 0x... [filling, waiters:0/3]>"
577
657
578
658
#: ../../library/asyncio-sync.rst:412
579
659
msgid ""
@@ -603,6 +683,11 @@ msgid ""
603
683
" # Only one task prints this\n"
604
684
" print('End of *draining phase*')"
605
685
msgstr ""
686
+ "...\n"
687
+ "async with barrier as position:\n"
688
+ " if position == 0:\n"
689
+ " # 오직 한 태스크만 이것을 인쇄합니다\n"
690
+ " print('End of *draining phase*')"
606
691
607
692
#: ../../library/asyncio-sync.rst:430
608
693
msgid ""
0 commit comments