Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Behaviors.logMessages implementation #26238
Behaviors.logMessages implementation #26238
Changes from all commits
fb5d798
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The untyped one actually invokes receive and looks at the result to be able to say if it was handled/unhandled in the log message, should we perhaps do that here as well? We could actually even log what the new behavior/state is. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that
LoggingReceive
usesisDefinedAt
to see if a message is handled an encodes that into the message. I wasn't sure how to do that with theBehavior
because I don't know how to access the underlyingPartialFunction
.I'm not sure what you mean by this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More of an idea than entirely sure we should do this but,
instead of logging before (or in addition to logging before perhaps) we could do something like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be useful. I can include it if you like.
I have a question regarding the following line
This is checking if the
newBehavior
is aBehavior.UnhandledBehavior
, but inLoggingReceive
the logic is checking whether a message is actually handled by a behavior, which can be done usingPartialFunction.isDefinedAt
. Is there a way to access the underlying PF of the behavior to do a similar check?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the typed case we don't know if it is a PF at all, so no, the only way to know that a message was unhandled is to call the behavior and look at the return value. Maybe we could skip that now and look into what would be useful in a follow up PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #26271 to track that