You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>All communication happens via <strong>MessagePack</strong> binary protocol over stdin/stdout:</p>
1606
-
<ol>
1607
-
<li>Java serializes a request (eval/exec/ref/callback/etc.) as a MessagePack frame</li>
1608
-
<li>The frame is prefixed with a 4-byte big-endian length header</li>
1609
-
<li>Python's <code>bridge.py</code> reads the length, then the full frame</li>
1610
-
<li>Python processes the request and writes a response frame back</li>
1611
-
<li>Java reads the response, deserializes, and returns the result</li>
1612
-
</ol>
1613
-
<h3id="why-messagepack">Why MessagePack?</h3>
1614
-
<table>
1615
-
<thead>
1616
-
<tr>
1617
-
<th>Format</th>
1618
-
<th>Size (typical)</th>
1619
-
<th>Speed</th>
1620
-
<th>Python support</th>
1621
-
</tr>
1622
-
</thead>
1623
-
<tbody>
1624
-
<tr>
1625
-
<td>MessagePack</td>
1626
-
<td>~50 bytes</td>
1627
-
<td>Fast (binary)</td>
1628
-
<td><code>msgpack</code> package</td>
1629
-
</tr>
1630
-
<tr>
1631
-
<td>JSON</td>
1632
-
<td>~120 bytes</td>
1633
-
<td>Medium</td>
1634
-
<td>Built-in</td>
1635
-
</tr>
1636
-
<tr>
1637
-
<td>Pickle</td>
1638
-
<td>~40 bytes</td>
1639
-
<td>Fast</td>
1640
-
<td>Built-in (unsafe)</td>
1641
-
</tr>
1642
-
</tbody>
1643
-
</table>
1644
-
<p>MessagePack provides a compact binary format with strong typing, making it well-suited for cross-process communication over stdin/stdout.</p>
1571
+
<p>All communication happens via a binary protocol over stdin/stdout. Each request is serialized, prefixed with a 4-byte big-endian length header, and read by <code>bridge.py</code>. Python processes the request and writes a response frame back.</p>
Copy file name to clipboardExpand all lines: examples/basic-eval/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1354,7 +1354,7 @@
1354
1354
1355
1355
<h1id="basic-eval">Basic Eval</h1>
1356
1356
<p>Demonstrates basic <code>PythonEmbed</code> usage: <code>eval()</code>, <code>exec()</code>, <code>PythonValue</code> type conversion, and safe parameter injection with <code>arg()</code>.</p>
Copy file name to clipboardExpand all lines: examples/batch-operations/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1354,7 +1354,7 @@
1354
1354
1355
1355
<h1id="batch-operations">Batch Operations</h1>
1356
1356
<p>Demonstrates batch evaluation and execution — sending multiple requests in a single round-trip to reduce protocol overhead. Both <code>PythonEmbed</code> (single instance) and <code>PythonEmbedPool</code> support batch operations.</p>
Copy file name to clipboardExpand all lines: examples/callback-bridge/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1354,7 +1354,7 @@
1354
1354
1355
1355
<h1id="callback-bridge">Callback Bridge</h1>
1356
1356
<p>Demonstrates Python-to-Java callbacks and push handlers. Python code can call Java methods via <code>_bridge.call("name", args...)</code> (synchronous) and <code>_bridge.push("name", value)</code> (fire-and-forget).</p>
Copy file name to clipboardExpand all lines: examples/configuration/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1354,7 +1354,7 @@
1354
1354
1355
1355
<h1id="configuration">Configuration</h1>
1356
1356
<p>Demonstrates the full <code>PythonEmbed.Options</code> builder: timeouts, environment variables, warmup scripts, code limits, close hooks, and explicit Python executable path.</p>
Copy file name to clipboardExpand all lines: examples/error-handling/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1354,7 +1354,7 @@
1354
1354
1355
1355
<h1id="error-handling">Error Handling</h1>
1356
1356
<p>Demonstrates Python error handling with detailed diagnostic information. Every Python exception is wrapped as a <code>PythonExecutionException</code> providing error type, cause code, and full Python traceback.</p>
Copy file name to clipboardExpand all lines: examples/health-monitor/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1354,7 +1354,7 @@
1354
1354
1355
1355
<h1id="health-monitor">Health Monitor</h1>
1356
1356
<p>Demonstrates health monitoring for PythonEmbed instances and pools. Use <code>ping()</code> for liveness checks and <code>health()</code> for detailed runtime statistics (memory, reference count, GC status).</p>
0 commit comments