Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

picoev: improve raw mode #19817

Merged
merged 2 commits into from
Nov 11, 2023
Merged

picoev: improve raw mode #19817

merged 2 commits into from
Nov 11, 2023

Conversation

Casper64
Copy link
Member

@Casper64 Casper64 commented Nov 9, 2023

Add callback function to picoev's raw callback mode that removes the file descriptor from the event loop.

Currently if you use the raw mode in picoev the file descriptor only gets removed from the event loop when a timeout occurs.
This pr also adds an example for picoev's raw mode.

🤖 Generated by Copilot at 6e57956

This pull request enhances the picoev module with a new option to remove file descriptors from the event loop. It also adds an example file to demonstrate the usage of this option and updates the testing module to skip this file.

🤖 Generated by Copilot at 6e57956

  • Add a new example file examples/pico/raw_callback.v that shows how to use the raw_cb option of the picoev module (link, link)
  • Modify the Config struct of the picoev module to include a remove function as a third argument to the raw_cb function type, allowing the user to control when to close the connection and free the resources (link, link)
  • Pass the remove function as a closure to the raw_cb function in the accept_cb function of the picoev module, using the del method of the picoev instance (link)

@Casper64 Casper64 requested a review from l1mey112 November 9, 2023 14:37
vlib/picoev/picoev.v Outdated Show resolved Hide resolved
@spytheman spytheman merged commit a176021 into vlang:master Nov 11, 2023
42 checks passed
@Casper64 Casper64 deleted the picoev_raw_mode branch November 11, 2023 09:53
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.

2 participants