… | |
… | |
406 | |
406 | |
407 | BEGIN { *async = \&Coro::async_pool } |
407 | BEGIN { *async = \&Coro::async_pool } |
408 | |
408 | |
409 | =item cf::sync_job { BLOCK } |
409 | =item cf::sync_job { BLOCK } |
410 | |
410 | |
411 | The design of Crossfire TRT requires that the main coroutine ($Coro::main) |
411 | The design of Deliantra requires that the main coroutine ($Coro::main) |
412 | is always able to handle events or runnable, as Crossfire TRT is only |
412 | is always able to handle events or runnable, as Deliantra is only |
413 | partly reentrant. Thus "blocking" it by e.g. waiting for I/O is not |
413 | partly reentrant. Thus "blocking" it by e.g. waiting for I/O is not |
414 | acceptable. |
414 | acceptable. |
415 | |
415 | |
416 | If it must be done, put the blocking parts into C<sync_job>. This will run |
416 | If it must be done, put the blocking parts into C<sync_job>. This will run |
417 | the given BLOCK in another coroutine while waiting for the result. The |
417 | the given BLOCK in another coroutine while waiting for the result. The |
… | |
… | |
662 | attach callbacks/event handlers (a collection of which is called an "attachment") |
662 | attach callbacks/event handlers (a collection of which is called an "attachment") |
663 | to it. All such attachable objects support the following methods. |
663 | to it. All such attachable objects support the following methods. |
664 | |
664 | |
665 | In the following description, CLASS can be any of C<global>, C<object> |
665 | In the following description, CLASS can be any of C<global>, C<object> |
666 | C<player>, C<client> or C<map> (i.e. the attachable objects in |
666 | C<player>, C<client> or C<map> (i.e. the attachable objects in |
667 | Crossfire TRT). |
667 | Deliantra). |
668 | |
668 | |
669 | =over 4 |
669 | =over 4 |
670 | |
670 | |
671 | =item $attachable->attach ($attachment, key => $value...) |
671 | =item $attachable->attach ($attachment, key => $value...) |
672 | |
672 | |