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
import time | |
import threading | |
def thing(key, value, queue, results): | |
print(f"Processing {key=} {value=}") | |
# what happens to the thread when there's an exception here? | |
# the thread should catch it and remove the job from the queue so that | |
# another can be enqueued. | |
results[key] = value ** 2 |
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
from asyncio.events import get_event_loop | |
from asyncio.tasks import ensure_future, wait | |
async def run_sync_task(loop, fn, *args): | |
return await loop.run_in_executor(None, fn, *args) | |
def greeting(name): | |
return f'Hello {name}' |
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
b.barracudacentral.org | |
bl.deadbeef.com | |
bl.emailbasura.org | |
bl.spamcannibal.org | |
bl.spamcop.net | |
blackholes.five-ten-sg.com | |
blacklist.woody.ch | |
bogons.cymru.com | |
cbl.abuseat.org | |
cdl.anti-spam.org.cn |