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

handler: make message filtering async-capable #48088

Merged
merged 3 commits into from
Jan 7, 2025
Merged

Conversation

jkarneges
Copy link
Member

@jkarneges jkarneges commented Dec 12, 2024

This introduces the MessageFilter class for implementing async filtering operations, specifically for messages. Response content (formerly "proxy" content) must still be filtered using the synchronous Filter API.

There are no actual async filters implemented yet, although all of the existing synchronous filters have been updated to derive from MessageFilter and emit async results immediately. This way we can start using the async API in connection handlers.

Longer term, the plan is to introduce a ResponseFilter class for similarly handling response content, and then turn Filter into a namespace. In preparation for this, MessageFilter and related types are nested under the Filter class.

The goal of this reworking is not only to enable async operations but also to make the filtering API more clear. Instead of a single class with different modes, we'll have different classes with single modes.

@jkarneges jkarneges changed the title add support for async message filters add async message filters Dec 12, 2024
@jkarneges jkarneges force-pushed the jkarneges/async-filters branch from 7f938e3 to 693165a Compare December 13, 2024 22:21
@jkarneges jkarneges changed the title add async message filters handler: make message filtering async-capable Dec 13, 2024
@jkarneges jkarneges force-pushed the jkarneges/async-filters branch from 693165a to 8ed402d Compare December 18, 2024 20:53
@jkarneges jkarneges marked this pull request as ready for review December 18, 2024 20:54
Copy link
Collaborator

@deg4uss3r deg4uss3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for including the test!

@jkarneges jkarneges merged commit 56936a9 into main Jan 7, 2025
19 checks passed
@jkarneges jkarneges deleted the jkarneges/async-filters branch January 7, 2025 19:39
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