This repository has been archived by the owner on Sep 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from nolar/log-queues-sync
Post k8s-events properly from multiple threads (thread-safe)
- Loading branch information
Showing
8 changed files
with
226 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import asyncio | ||
|
||
import pytest | ||
|
||
from kopf.engines.posting import event_queue_var, event_queue_loop_var | ||
|
||
|
||
@pytest.fixture() | ||
def event_queue_loop(event_loop): | ||
token = event_queue_loop_var.set(event_loop) | ||
try: | ||
yield event_loop | ||
finally: | ||
event_queue_loop_var.reset(token) | ||
|
||
|
||
@pytest.fixture() | ||
def event_queue(event_loop): | ||
queue = asyncio.Queue(loop=event_loop) | ||
token = event_queue_var.set(queue) | ||
try: | ||
yield queue | ||
finally: | ||
event_queue_var.reset(token) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.