sourced-message 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sourced/message.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed1d286c9bef9ab9e75beabbfbb49b55c6344cc72de2bdb205fe99310772ec2d
|
|
4
|
+
data.tar.gz: 87ac27cc91b21844ec3f2a589812c4cf1fd5c0474c20d30583da2606c91df230
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 486e6c9c81391ac43ee46c705a8662bd4263578ce687fe7d5c7555a5c48c345ebbeb31691c2b7cc081e92030567bdeece3198c1cc8fe225811fa409b97b16dfd
|
|
7
|
+
data.tar.gz: ad1f09cf84d7853d86d0b4586bae17e307a2391a1efd551ae839c430cd3240485daadd4cd178da93c63f41d55a6f2600f439c4f9f57e5ff26d061b5829cefd38
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
- `Message#created_at` is kept to the microsecond, the precision `Plumb::Codec::JSON`
|
|
4
|
+
encodes, so a message equals itself read back from JSON. On Linux, `Time.now` has
|
|
5
|
+
nanoseconds, so a message and its stored copy differed in `created_at`. Every way of
|
|
6
|
+
setting it is truncated: the default, a `created_at:` passed in, `#with` and `#at`.
|
|
3
7
|
- `Message#at` with a duration string (`'1h30m'`) raised `ArgumentError` ("Cannot
|
|
4
8
|
determine timezone from \"BST\"") in the hour the clocks go back. The duration's
|
|
5
9
|
seconds are now added to `Time.now`, exactly. Durations in months or years, which
|
data/lib/sourced/message.rb
CHANGED
|
@@ -22,7 +22,7 @@ module Sourced
|
|
|
22
22
|
# +Sourced::Message.registry[type]+ resolves a type registered under any
|
|
23
23
|
# subclass. Resolve from this root to see the whole tree.
|
|
24
24
|
class Message < Plumb::Types::Data
|
|
25
|
-
VERSION = '0.5.
|
|
25
|
+
VERSION = '0.5.3'
|
|
26
26
|
|
|
27
27
|
EMPTY_ARRAY = [].freeze
|
|
28
28
|
|
|
@@ -62,7 +62,9 @@ module Sourced
|
|
|
62
62
|
attribute :type, Types::String.present
|
|
63
63
|
attribute? :causation_id, Types::UUID::V4
|
|
64
64
|
attribute? :correlation_id, Types::UUID::V4
|
|
65
|
-
|
|
65
|
+
# Kept to the microsecond, as Plumb::Codec::JSON encodes it, so a message equals
|
|
66
|
+
# itself read back from JSON (Linux clocks have nanoseconds).
|
|
67
|
+
attribute :created_at, LaxTime.default { Time.now }.transform(::Time) { |t| t.floor(6) }
|
|
66
68
|
attribute :metadata, Types::Metadata.default(Plumb::BLANK_HASH)
|
|
67
69
|
# Envelope, not payload: {#correlate} leaves the target's tags alone, so they
|
|
68
70
|
# never pass on to messages produced in reaction.
|