-
Notifications
You must be signed in to change notification settings - Fork 38
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
[Streaming Replication 7th] Replication Mode Messages Handling #58
Conversation
This helps letting the MessageFramer to be aganostic to ReplicationMode
tests were added as well
LogicalReplicationMessage parseLogicalReplicationMessage(Uint8List bytesList) { | ||
/// Tries to check if the [XLogDataMessage.bytes] is a [LogicalReplicationMessage] | ||
/// If so, it'll return | ||
XLogDataMessage tryParseLogicalReplicationMessage(XLogDataMessage message) { |
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 my experience tryX
usually returns T?
: either T
if successful, or null
if not. This method seems to be better places on the XLogDataMessage
(either directly or through an extension method) and named cast
or castToLogicalReplication
, especially if those message have a LogicalReplicationMessage
interface or superclass. 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.
Good catch and I totally agree with you.
I added XLogDataMessage.parse
and made tryParseLogicalReplicationMessage
returns LogicalReplicationMessage?
. Let me know if it looks better.
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.
looks good, thank you!
This PR includes the following changes/additions:
I'll submit a final PR after this to update changelogs, version, and readme.