service_mesh 0.4.1 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fef05ef9dacd492215d76304b8f1938056e862e35c0e0450f7b120213bf7e8d7
4
- data.tar.gz: 97cb3e42dc4797d618d3eacf61aa3d2ba994887aa94ee88d37d90b6b04211fb6
3
+ metadata.gz: edccbfa1e181934bed8df91ecb53d15849335cb10730450e088fee1e28ac44ef
4
+ data.tar.gz: 64cbe1ba2b464e7ccd1dc840066eedf2dd0cd4639804af86e0fde65615cf064c
5
5
  SHA512:
6
- metadata.gz: c7da5185432f80a50b73ec3942c736367455bc337918b7afba2b8393a1575353e54a9fbdb54d98aeaf03c7b0922766490a8da075c8daf4d2a58087044e1e448b
7
- data.tar.gz: 4418d34275bc4dd1d532b4b84f48361967601275181c64c50c5cb7ca7177ddecd9ebdedbb773d813d07e55307efeb24b63c2753a8c6881ea66803e1e619f3127
6
+ metadata.gz: bdff9e8e86405e3fcca5df769e800d317df47307d4974c88f9161728c165242ecfa7acf72880bfb41b2606f310c30a6fd6cf35dbb56d22dab202d27e1201725f
7
+ data.tar.gz: c3513ecbc6ae3832509419f8f3b9e9c93c637199eb6d8fd9b9183ef4046bf75d53dd3cc1cc73ee6d16dcaa2b116626956068ce3e3569404aba69bb90e0bc3e7a
data/README.md CHANGED
@@ -1,15 +1,11 @@
1
1
  # service-mesh-ruby
2
2
 
3
- The Ruby contract for the
4
- [Service Mesh API Specification](https://github.com/Paymentbox-com/service-mesh-api),
5
- packaged as the gem `service_mesh`. It holds what every transport and every
3
+ service-mesh-ruby is the Ruby contract for the
4
+ [Service Mesh API Specification](https://github.com/Paymentbox-com/service-mesh-api).
5
+ It is packaged as the gem `service_mesh`. It holds what every transport and every
6
6
  caller must agree on, and nothing that moves bytes. Transports are separate
7
7
  gems that depend on it and implement `Client` and `Runtime`.
8
8
 
9
- The [gRPC Service Mesh API](https://github.com/Paymentbox-com/grpc-service-mesh-api) is a protocol layer that generates code against this contract from protobuf
10
- definitions, through its Ruby library [grpc-service-mesh-ruby](https://github.com/Paymentbox-com/grpc-service-mesh-ruby). Other protocol layers may be implemented
11
- to do the same.
12
-
13
9
  ## Install
14
10
 
15
11
  ```ruby
@@ -21,34 +17,27 @@ Requires Ruby 3.3 or newer. The gem has no runtime dependencies.
21
17
 
22
18
  ## What it Implements
23
19
 
24
- - The value types from the specification: `ServiceMesh::Target`, `ServiceMesh::ServiceMap`,
25
- `ServiceMesh::Message`, `ServiceMesh::Endpoint` and `ServiceMesh::Subscriber`.
20
+ - The value types from the specification: `ServiceMesh::Target`, `ServiceMesh::ServiceMap`,
21
+ `ServiceMesh::Message`, `ServiceMesh::Endpoint`, and `ServiceMesh::Subscriber`.
26
22
  - Target Kinds are implemented as `:route` and `:topic`. A `Target` built with a kind outside the two
27
23
  raises `KindMismatch`.
28
24
  - `Message#payload` is always `Encoding::BINARY`.
29
- - `Target#same_channel?` compares segments and kind and ignores metadata.
30
- - The configuration keys the specification defines: `DEPLOYMENT_GROUP_KEY`,
31
- `CONSUMER_GROUP_KEY`, and the value `CONSUMER_GROUP_NONE`.
25
+ - `Target#same_channel?` compares segments and kind and ignores metadata.
26
+ - The configuration keys the specification defines. `DEPLOYMENT_GROUP_KEY` is runtime
27
+ configuration. `CONSUMER_GROUP_KEY`, with the value `CONSUMER_GROUP_NONE`, is `Endpoint` and
28
+ `Subscriber` metadata.
32
29
  - The errors defined by the specification as `ServiceMesh::Error`: `ServiceMesh::KindMismatch`,
33
- `ServiceMesh::InvalidTarget`, `ServiceMesh::NoDeploymentGroup`.
30
+ `ServiceMesh::InvalidTarget`, and `ServiceMesh::NoDeploymentGroup`.
34
31
  - A conformance suite a transport runs against its own `Client` and
35
32
  `Runtime`.
36
33
 
37
- `Client` and `Runtime` are duck types. The specification names their methods;
38
- a transport satisfies the contract by responding to them and by passing the
34
+ `Client` and `Runtime` are duck types. The specification names their methods,
35
+ and a transport satisfies the contract by responding to them and by passing the
39
36
  conformance suite.
40
37
 
41
- ## Transports
42
-
43
- - NATS: [service-mesh-nats-ruby](https://github.com/Paymentbox-com/service-mesh-nats-ruby),
44
- gem `service_mesh_nats`.
45
-
46
- The Go counterpart of this gem is
47
- [service-mesh-go](https://github.com/Paymentbox-com/service-mesh-go).
48
-
49
38
  ## Usage
50
39
 
51
- A transport that implements Client and Runtime according to the specification will used the
40
+ A transport that implements `Client` and `Runtime` according to the specification uses the
52
41
  types defined here.
53
42
 
54
43
  ```ruby
@@ -84,10 +73,18 @@ RSpec.describe MyTransport do
84
73
  end
85
74
  ```
86
75
 
87
- The suite covers kind checks, the deployment group requirement, request and
88
- reply with metadata both ways, publish, the consumer-group delivery
89
- permutations across two runtimes, a standalone client refusing requests after
90
- close, the runtime's client being the one it was given and closed by stop, the lifecycle state machine, and drain completing and expiring.
76
+ The suite covers:
77
+
78
+ - kind checks
79
+ - the deployment group requirement
80
+ - request and reply with metadata both ways
81
+ - publish
82
+ - the consumer-group delivery permutations across two runtimes
83
+ - a standalone client refusing requests after close
84
+ - the runtime's client being the one it was given and closed by stop
85
+ - the lifecycle state machine
86
+ - drain completing and expiring
87
+
91
88
  Anything that names a transport's own errors, config keys, or address syntax
92
89
  stays in the transport's specs.
93
90
 
@@ -97,10 +94,9 @@ stays in the transport's specs.
97
94
  mise install
98
95
  just install
99
96
  just check # lint, test, build
97
+ just test # tests only
100
98
  ```
101
99
 
102
- ## Tests
103
-
104
- ```
105
- just test
106
- ```
100
+ Releasing is described in [publishing.md](publishing.md). `just bump patch`,
101
+ `just bump minor`, or `just bump major` raises the version in
102
+ `lib/service_mesh/version.rb` and commits that file.
@@ -161,14 +161,18 @@ RSpec.shared_examples "a service mesh transport" do
161
161
  end
162
162
  end
163
163
 
164
- it "honours a group set on the target rather than the binding" do
164
+ it "ignores a group set on the target, which carries none" do
165
165
  count = Queue.new
166
166
  %w[a b].each do |group|
167
167
  t = ServiceMesh::Target.new(segments: topic_target.segments, kind: :topic, metadata: {ServiceMesh::CONSUMER_GROUP_KEY => group})
168
168
  serve(config_for("same"), subscribers: [subscriber(t, ->(_) { count << true })])
169
169
  end
170
+
170
171
  client.publish(message(topic_target))
171
- wait_until { count.size == 2 }
172
+
173
+ wait_until { count.size >= 1 }
174
+ sleep 0.1 # let an unwanted extra delivery show up
175
+ expect(count.size).to eq(1)
172
176
  end
173
177
  end
174
178
 
@@ -4,7 +4,10 @@ module ServiceMesh
4
4
  KINDS = %i[route topic].freeze
5
5
 
6
6
  # Configuration keys the specification defines. Everything else belongs to
7
- # a transport.
7
+ # a transport. DEPLOYMENT_GROUP_KEY is runtime configuration, and nothing
8
+ # else carries it. CONSUMER_GROUP_KEY is Endpoint and Subscriber metadata;
9
+ # when it is unset or empty, the runtime's deployment group applies, and
10
+ # CONSUMER_GROUP_NONE means no group. A Target carries neither.
8
11
  DEPLOYMENT_GROUP_KEY = "deployment_group"
9
12
  CONSUMER_GROUP_KEY = "consumer_group"
10
13
  CONSUMER_GROUP_NONE = "none"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ServiceMesh
4
- VERSION = "0.4.1"
4
+ VERSION = "0.5.0"
5
5
  end
metadata CHANGED
@@ -1,17 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: service_mesh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
+ - Bryant Morrill
7
8
  - Paymentbox
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2026-09-25 00:00:00.000000000 Z
12
+ date: 2026-09-30 00:00:00.000000000 Z
12
13
  dependencies: []
13
14
  description:
14
15
  email:
16
+ - bryantreadmorrill@gmail.com
15
17
  executables: []
16
18
  extensions: []
17
19
  extra_rdoc_files: []