… | |
… | |
163 | |
163 | |
164 | Create a new asynchronous process and return it's process object |
164 | Create a new asynchronous process and return it's process object |
165 | (usually unused). When the sub returns the new process is automatically |
165 | (usually unused). When the sub returns the new process is automatically |
166 | terminated. |
166 | terminated. |
167 | |
167 | |
|
|
168 | When the coroutine dies, the program will exit, just as in the main |
|
|
169 | program. |
|
|
170 | |
168 | # create a new coroutine that just prints its arguments |
171 | # create a new coroutine that just prints its arguments |
169 | async { |
172 | async { |
170 | print "@_\n"; |
173 | print "@_\n"; |
171 | } 1,2,3,4; |
174 | } 1,2,3,4; |
172 | |
175 | |
… | |
… | |
241 | |
244 | |
242 | =cut |
245 | =cut |
243 | |
246 | |
244 | =item $process->cancel (arg...) |
247 | =item $process->cancel (arg...) |
245 | |
248 | |
246 | Temrinates the given process and makes it return the given arguments as |
249 | Terminates the given process and makes it return the given arguments as |
247 | status (default: the empty list). |
250 | status (default: the empty list). |
248 | |
251 | |
249 | =cut |
252 | =cut |
250 | |
253 | |
251 | sub cancel { |
254 | sub cancel { |