-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support Ruby's Time class in msgpack serde #2775
Conversation
Recent msgpack-ruby can (de)serialize Time class. Add enable_msgpack_time_support parameter to system config for this feature. This is useful for multiple time fields. Signed-off-by: Masahiro Nakagawa <[email protected]>
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.
Almost seems good, but I added a comment due to a nitpick.
@@ -70,9 +70,15 @@ def self.unpacker(*args) | |||
factory.unpacker(*args) | |||
end | |||
|
|||
def self.init | |||
def self.init(enable_time_support: false) |
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.
Should we register MessagePack::Timestamp::TYPE
in self.factory
as well? Or it needn't to be registered there? 🤔
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.
Ah, I forgot self.factory
because it is used in only tests...
Signed-off-by: Masahiro Nakagawa <[email protected]>
Applied reviews. |
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 to me. 👍
Signed-off-by: Masahiro Nakagawa [email protected]
Which issue(s) this PR fixes:
No issue.
What this PR does / why we need it:
Recent msgpack-ruby can (de)serialize Time class.
Add
enable_msgpack_time_support
parameter to system config for this feature.This is useful for multiple time fields.
See also: https://github.com/msgpack/msgpack-ruby#serializing-and-deserializing-time-instances
fluentd v2 will enable this feature by default.
Docs Changes:
Will add
enable_msgpack_time_support
to system config article after merged the patch.Release Note:
Same as title.