… | |
… | |
212 | Similar to C<async>, but uses a coroutine pool, so you should not call |
212 | Similar to C<async>, but uses a coroutine pool, so you should not call |
213 | terminate or join on it (although you are allowed to), and you get a |
213 | terminate or join on it (although you are allowed to), and you get a |
214 | coroutine that might have executed other code already (which can be good |
214 | coroutine that might have executed other code already (which can be good |
215 | or bad :). |
215 | or bad :). |
216 | |
216 | |
217 | On the plus side, this function is faster than creating (and destroying) |
217 | On the plus side, this function is about twice as fast as creating (and |
218 | a completly new coroutine, so if you need a lot of generic coroutines in |
218 | destroying) a completely new coroutine, so if you need a lot of generic |
219 | quick successsion, use C<async_pool>, not C<async>. |
219 | coroutines in quick successsion, use C<async_pool>, not C<async>. |
220 | |
220 | |
221 | The code block is executed in an C<eval> context and a warning will be |
221 | The code block is executed in an C<eval> context and a warning will be |
222 | issued in case of an exception instead of terminating the program, as |
222 | issued in case of an exception instead of terminating the program, as |
223 | C<async> does. As the coroutine is being reused, stuff like C<on_destroy> |
223 | C<async> does. As the coroutine is being reused, stuff like C<on_destroy> |
224 | will not work in the expected way, unless you call terminate or cancel, |
224 | will not work in the expected way, unless you call terminate or cancel, |