Skip to content

Instantly share code, notes, and snippets.

View nathanielobrown's full-sized avatar

Nathaniel Brown nathanielobrown

View GitHub Profile
import asyncio
import concurrent.futures
from datetime import timedelta
from temporalio import activity, workflow
from temporalio.testing import WorkflowEnvironment
from temporalio.worker import UnsandboxedWorkflowRunner, Worker
started_event = asyncio.Event()
@nathanielobrown
nathanielobrown / test_activity_cancellation.py
Last active January 30, 2023 18:36
Testing delivery of activity cancellation exceptions (CacelledError) for the Temporal Python SDK
import concurrent.futures
import time
from datetime import timedelta
import requests
import rich
from temporalio import activity, workflow
from temporalio.client import WorkflowFailureError
from temporalio.exceptions import CancelledError
from temporalio.testing import WorkflowEnvironment
@nathanielobrown
nathanielobrown / install_jupyter_notebook_launch_agent.sh
Last active July 11, 2017 15:01
script to install a jupyter launch agent on MacOS
cat <<EOF > ~/Library/LaunchAgents/com.$(whoami).jupyternotebook.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.$(whoami).jupyternotebook</string>
<key>ProgramArguments</key>
@nathanielobrown
nathanielobrown / install_jupyterlab_launch_agent.sh
Last active October 29, 2019 12:49
script to install a jupyter lab launch agent on MacOS
cat <<EOF > ~/Library/LaunchAgents/com.$(whoami).jupyterlab.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.$(whoami).jupyterlab</string>
<key>ProgramArguments</key>