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

feat: add ExecuteUntil to event dispatchers, add EventDispatcherThreadAware #526

Merged
merged 4 commits into from
Jan 13, 2024

Conversation

richardapeters
Copy link
Collaborator

No description provided.

@richardapeters richardapeters requested a review from a team as a code owner January 13, 2024 06:39
Copy link
Contributor

github-actions bot commented Jan 13, 2024

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Manifest Files

Copy link
Contributor

github-actions bot commented Jan 13, 2024

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 12 0 0.06s
✅ CPP clang-format 939 2 0 6.26s
✅ DOCKERFILE hadolint 2 0 0.1s
✅ JSON eslint-plugin-jsonc 8 0 0 2.84s
✅ JSON jsonlint 8 0 0.13s
✅ JSON prettier 8 0 0 0.6s
⚠️ MARKDOWN markdownlint 6 0 4 1.54s
⚠️ MARKDOWN markdown-link-check 6 1 42.6s
✅ MARKDOWN markdown-table-formatter 6 0 0 0.38s
✅ REPOSITORY checkov yes no 20.82s
✅ REPOSITORY git_diff yes no 0.07s
✅ REPOSITORY grype yes no 17.03s
✅ REPOSITORY secretlint yes no 6.89s
✅ REPOSITORY trivy yes no 9.29s
✅ REPOSITORY trivy-sbom yes no 1.38s
✅ REPOSITORY trufflehog yes no 4.11s
⚠️ SPELL lychee 135 3 1.83s
⚠️ YAML prettier 22 0 1 1.25s
✅ YAML v8r 22 0 12.23s
✅ YAML yamllint 22 0 0.4s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@richardapeters richardapeters changed the title feat: infra/event/EventDispatcher{WithWeakPtr}: Add ExecuteUntil feat: add ExecuteUntil to event dispatchers, add EventDispatcherThreadAware Jan 13, 2024
Copy link
Contributor

@daantimmer daantimmer left a comment

Choose a reason for hiding this comment

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

I think the current ExecuteUntil functions should take an templates Predicate. This allows the caller to provide a lambda with more captures than what infra:: Function allows.

Much like how the Subject/Observer Notify functions work.

infra/event/test/TestEventDispatcherThreadAware.cpp Outdated Show resolved Hide resolved
infra/event/test/TestEventDispatcherWithWeakPtr.cpp Outdated Show resolved Hide resolved
infra/event/test/TestEventDispatcherWithWeakPtr.cpp Outdated Show resolved Hide resolved
infra/event/test/TestEventDispatcherWithWeakPtr.cpp Outdated Show resolved Hide resolved
infra/event/test/TestEventDispatcherThreadAware.cpp Outdated Show resolved Hide resolved
infra/event/test/TestEventDispatcher.cpp Outdated Show resolved Hide resolved
infra/event/test/TestEventDispatcher.cpp Outdated Show resolved Hide resolved
infra/event/test/TestEventDispatcher.cpp Outdated Show resolved Hide resolved
infra/event/EventDispatcherWithWeakPtr.cpp Show resolved Hide resolved
infra/event/EventDispatcher.cpp Show resolved Hide resolved
richardapeters and others added 2 commits January 13, 2024 10:55
Co-authored-by: Daan Timmer <8293597+daantimmer@users.noreply.github.com>
Co-authored-by: Daan Timmer <8293597+daantimmer@users.noreply.github.com>
Copy link

@richardapeters
Copy link
Collaborator Author

I think the current ExecuteUntil functions should take an templates Predicate. This allows the caller to provide a lambda with more captures than what infra:: Function allows.

Using infra::Function avoids having a method template, and is in line with how amp-embedded-infra-lib uses functions. I am still considering adding an interface on top of Run/ExecuteAllActions/ExecuteUntil somewhere in the future; that requires ExecuteUntil to not be a method template.

@richardapeters richardapeters added this pull request to the merge queue Jan 13, 2024
Merged via the queue into main with commit d05d1f3 Jan 13, 2024
32 checks passed
@richardapeters richardapeters deleted the feature/execute-until branch January 13, 2024 13:20
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