Skip to content

[Sync-EN] Optimize the Swoole event documentation - #1806

Open
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:sync-en/1618
Open

[Sync-EN] Optimize the Swoole event documentation#1806
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:sync-en/1618

Conversation

@lacatoire

Copy link
Copy Markdown
Member

Syncs the reference/swoole/ event pages with php/doc-en#4774.

The Swoole\Event pages were essentially empty stubs: the class intro, every method description and almost every parameter description held an empty paragraph. They are now translated in full:

  • swoole.event.xml: the intro explains that the extension exposes the underlying epoll/kqueue/poll/select loop and lets sockets from other extensions join it, with the note that the module is low-level. Two new sections are added: event priority, and the four accepted socket types (fd, stream resource, socket resource, object).
  • Swoole\Event::add(), del(), set(), wait(), write(), defer(): full descriptions, parameters, return values, examples and the accompanying notes and warnings, including that a socket cannot be added twice, that del() must be called before closing a socket to avoid leaks, the set() callback replacement rules, and the write() buffer overflow behaviour and SSL restriction.
  • Adds Swoole\Event::cycle(), Swoole\Event::dispatch() and Swoole\Event::isset(), translating the three new pages.
  • Removes swoole/event/exit.xml, as upstream; the procedural swoole_event_exit() page is untouched.

The add() and set() synopses also gain the correct types: sock is mixed, not int/string, and the fourth parameter is flags of type int, not events of type string.

EN-Revision bumped to 282797eedc7c7bca6a6f55a9aad32b135feb3320 on the affected files.

Fixes: #1618

@lacatoire
lacatoire requested a review from a team as a code owner August 31, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sync EN] optimize swoole event docs

1 participant