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
Copy file name to clipboardExpand all lines: README.md
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,25 +69,23 @@ p(20)
69
69
70
70
### pipe with parallelism
71
71
72
-
By default, pipe works with green threads which is based on event loop.
72
+
By default, pipe works with threads which is based on event loop.
73
73
74
-
You can have a function running in a seperate green thread with pipe. Just put it in a `[]` or more explicitly `g[]`. Threads and processes are also available.
74
+
You can have a function running in a seperate thread with pipe. Just put it in a `[]` or more explicitly `t[]`. Threads and processes are also available.
75
75
76
76
```python
77
-
from syntax_sugar import (green_thread_syntax as g,
78
-
thread_syntax as t,
77
+
from syntax_sugar import (thread_syntax as t,
79
78
process_syntax as p)
80
79
81
-
pipe(10) | [print] |END# print run in a green thread
82
-
pipe(10) | g[print] |END# print run in a green thread
80
+
pipe(10) | [print] |END# print run in a thread
83
81
pipe(10) | t[print] |END# print run in a thread
84
82
pipe(10) | p[print] |END# print run in a process
85
83
```
86
84
87
-
What makes this syntax good is that you can specify how many green threads you want to spawn, by doing `[function] * n` where `n` is the number of green threads.
85
+
What makes this syntax good is that you can specify how many threads you want to spawn, by doing `[function] * n` where `n` is the number of threads.
88
86
89
87
```python
90
-
pipe([1,2,3,4,5]) | [print] *3|END# print will run in a GreenThreadPool of size 3
88
+
pipe([1,2,3,4,5]) | [print] *3|END# print will run in a ThreadPool of size 3
91
89
```
92
90
93
91
Here is an example of requesting a list of urls in parallel
@@ -96,7 +94,7 @@ Here is an example of requesting a list of urls in parallel
0 commit comments