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

ref(processor): Implement a new structure for the processor #4420

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

iambriccardo
Copy link
Member

@iambriccardo iambriccardo commented Dec 27, 2024

This PR introduces a new processor structure, currently implemented for check-ins only.

The new structure has the following goals:

  • Each processing group is defined in its own file. The file should contain the processing logic and all the methods specific to that group.
  • Shared processing functions should be placed in the common folder inside groups.
  • The state of each group is built from a common set of parameters, with the state clearly defined for each processing group. This makes it easy to understand the functionality of each group.
  • All processing functions now use a GroupPayload abstraction, which abstracts away whether the function operates on the ManagedEnvelope and the Event or only the ManagedEnvelope.
  • Dispatch of processing is done statically via a macro, which requires pairs of ProcessingGroup -> ProcessGroup.
  • The processor will have less and less code that will be moved into each individual group.

Upcoming work:

  • Continue porting processing groups to the new structure and move the group specific functions into their own group within groups.
  • Move ProcessingGroup into the groups module in addition to other structs.
  • Refine the abstractions further, if necessary.

@@ -3073,6 +3056,117 @@ impl Service for EnvelopeProcessorService {
}
}

#[cfg(feature = "processing")]
fn enforce_quotas<'a, G: Group, P: GroupPayload<'a, G>>(
Copy link
Member Author

Choose a reason for hiding this comment

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

Temporarily duplicated, to make it work for both old and new processing mechanism.

@iambriccardo iambriccardo changed the title ref(processor): Implement a new mechanism for the processor ref(processor): Implement a new structure for the processor Dec 30, 2024
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.

1 participant