From 0956b843a409c895e84be7e00703b775f3dc514a Mon Sep 17 00:00:00 2001
From: Tyler Goodlet <jgbt@protonmail.com>
Date: Wed, 26 Jan 2022 23:38:33 -0500
Subject: [PATCH] Add a pre-started breakpoint example

---
 examples/debugging/subactor_bp_in_ctxt.py | 30 +++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 examples/debugging/subactor_bp_in_ctxt.py

diff --git a/examples/debugging/subactor_bp_in_ctxt.py b/examples/debugging/subactor_bp_in_ctxt.py
new file mode 100644
index 000000000..827bd858e
--- /dev/null
+++ b/examples/debugging/subactor_bp_in_ctxt.py
@@ -0,0 +1,30 @@
+import tractor
+import trio
+
+
+@tractor.context
+async def just_bp(
+    ctx: tractor.Context,
+) -> None:
+
+    await tractor.breakpoint()
+    await ctx.started('yo bpin here')
+
+
+async def main():
+    async with tractor.open_nursery(
+        debug_mode=True,
+    ) as n:
+        p = await n.start_actor(
+            'bp_boi',
+            enable_modules=[__name__],
+        )
+        async with p.open_context(
+            just_bp,
+        ) as (ctx, first):
+
+            await trio.sleep_forever()
+
+
+if __name__ == '__main__':
+    trio.run(main)