diff options
| author | Guido van Rossum <guido@python.org> | 2013-10-08 16:26:29 -0700 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 2013-10-08 16:26:29 -0700 |
| commit | 4c5456f861db9ac964c0e1777acf4a4bdf5f263a (patch) | |
| tree | c8cec180b999a008e65477c271c2b1ba22839511 | |
| parent | 1e441e949f2ad99bc75f36e7bcd19950a4d80647 (diff) | |
| download | trollius-git-4c5456f861db9ac964c0e1777acf4a4bdf5f263a.tar.gz | |
Move stack example.
| -rw-r--r-- | examples/stacks.py (renamed from t.py) | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/t.py b/examples/stacks.py index 8951809..77a99cf 100644 --- a/t.py +++ b/examples/stacks.py @@ -1,3 +1,6 @@ +"""Crude demo for print_stack().""" + + from tulip import * @@ -5,15 +8,8 @@ from tulip import * def helper(r): print('--- helper ---') for t in Task.all_tasks(): - print('[[[') t.print_stack() - print(']]]') print('--- end helper ---') - print(Task.all_pending_tasks()) - print(Task.all_done_tasks()) - print(Task.all_successful_tasks()) - print(Task.all_failed_tasks()) - print(Task.all_excepted_tasks()) line = yield from r.readline() 1/0 return line @@ -24,11 +20,6 @@ def doit(): r, w = lr(open_connection('python.org', 80)) t1 = async(helper(r)) for t in Task.all_tasks(): t.print_stack() - print(Task.all_pending_tasks()) - print(Task.all_done_tasks()) - print(Task.all_successful_tasks()) - print(Task.all_failed_tasks()) - print(Task.all_excepted_tasks()) print('---') l._run_once() for t in Task.all_tasks(): t.print_stack() @@ -40,16 +31,8 @@ def doit(): except Exception as e: print('catching', e) finally: - print(Task.all_pending_tasks()) - print(Task.all_done_tasks()) - print(Task.all_successful_tasks()) - print(Task.all_failed_tasks()) - print(Task.all_excepted_tasks()) - print(Task.all_cancelled_tasks()) for t in Task.all_tasks(): - print('[[[') t.print_stack() - print(']]]') def main(): |
