Messaging Patterns LabPython · ZeroMQ

Field notes

Before you begin

Start with basic Python functions, lists, dictionaries and exceptions. Read the setup and the question before each experiment. Run the original code, then try the suggested change. You can also read the worked result and answer the understanding question without running code.

Use Mark chapter as read to track your place. Try the question and its explanation to check your understanding.

What Run starts

Python prepares automatically while you read an executable lesson. It keeps the environment ready for subsequent runs. Each execution starts a fresh Python process with private writable files, sockets and Linux namespaces. The compatibility runner starts a new guest each time when required. Python uses real ZeroMQ sockets inside that environment. The request/reply and proxy lessons start two separate Python processes. Several other examples use more than one socket inside a single process.

The first run loads about 71 MiB. Use a desktop browser with enough available memory. The reading path works without JavaScript or a Linux download. Chromium is tested for execution.

Stop and Restart Python discard the guest, processes and queued messages. They preserve your editor and the last completed output. A new run starts from the example’s setup. This browser saves edited code, reading marks and your theme when storage is available. Download the code if you want a copy outside the browser. Export run saves the last successful output and the code that produced it.

What the experiments show

ZeroMQ performs the local socket operations. The Python examples add their own rules for skipping duplicate IDs, giving permission to send work, detecting gaps and sharing the latest value. Those rules keep their data only for the current run. Test storage, recovery and network failures separately when you need production guarantees.

Where your code runs

Your editor code runs on your device. The browser fetches the course files. Guest sockets can communicate inside the temporary Linux environment. Execution requires no account or remote server.

Comparing performance

Run shows the elapsed time for this browser, including startup. The export records the full button-to-result wait, including initialization retries, in elapsed_ms. Per-attempt timings list preparation, guest startup, isolated-process startup and execution separately. The native benchmark guide explains how to measure a completed local exchange on your own Linux machine.

Versions, downloads and time limits

The runtime uses CPython 3.12.16, PyZMQ 27.3.0 and libzmq 4.3.5 inside container2wasm/Bochs. The browser checks downloaded assets against their published hashes. When storage is available, the browser can reuse verified assets across chapters. Automatic preparation avoids repeated boots and trusted helper imports. Writable scratch is limited to 32 MiB, installed system directories are read-only, and /proc is unavailable in fast mode. The diagnostic full-guest runner supports system inspection. Browsers without WebAssembly JSPI use the compatible full-guest runner automatically. Navigating to another lesson starts a new session.

The runtime can spend up to five minutes loading assets. If guest startup takes more than 60 seconds, the runtime tries starting the guest again once before Python runs. Once Python starts, it can run for up to three minutes. After that, the environment stops. You can edit the code and try again.

Runtime source and build · Component notices · Runtime hashes · Font licenses

Primary sources

Use the documentation for the version your service runs.