service_mesh_nats 0.5.1 → 0.6.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: 20a1213855e080bc361b292f2708b4f023ba38a5051c3ebddffc39cf55b91f7c
4
- data.tar.gz: fd6939fad816e2beb146fbd8c3697b1221dabb3938a08bdbd73c23664488d71f
3
+ metadata.gz: 683e607b098b1fd2c8a5aa3d2d89182658f2cc7271523456f4d0c50879a2748f
4
+ data.tar.gz: 0202c5b52d82746c1ecf86204efc29326c64f1b5edf60bcb6052c538bc26bed5
5
5
  SHA512:
6
- metadata.gz: 411c35df69a5c8bf43b9ce66e088d666e129c34e64e93a6be3408a471775813f427cb32813a1e47a49bdbaa0e69f56e449ee8e73ee720c397646a70b187c6c0e
7
- data.tar.gz: 9fbde8fda5e37e58e4d08b0ffe9fe341098bdf5f84d241ddba5bace38003fcf974517bd2cd009deeb5f28cf45f828e3f1f79aa48f2593e1eec4c8f2355dd5f55
6
+ metadata.gz: 423a075d243dcc467dc0208a5c5fdb2881c70c03af0c602f48ce0b461a19e2efb08fa68158122724a74cdbecac04e105b459eb49ba492d9ec9b7315f3fa522ed
7
+ data.tar.gz: 7e63ac578689eecbe34d4b3ee8b1880868eb4d1e40d7ec27e994e0ff8bcb2e911be6ec72ffb301d8fdb203d209b4fc6ec08a89c8c4e6a1861ec30d67b2727519
data/README.md CHANGED
@@ -1,9 +1,20 @@
1
1
  # service-mesh-nats-ruby
2
2
 
3
- `service_mesh_nats` is the NATS transport implementation in Ruby for the
4
- [Service Mesh API Specification](https://github.com/Paymentbox-com/service-mesh-api).
5
-
6
- This gem depends on the contract types and errors in [service-mesh-ruby](https://github.com/Paymentbox-com/service-mesh-ruby).
3
+ service-mesh-nats-ruby is the Ruby implementation of the
4
+ [Service Mesh API Specification](https://github.com/Paymentbox-com/service-mesh-api)
5
+ over NATS. It implements the Ruby contract in the `service_mesh` gem, from
6
+ [service-mesh-ruby](https://github.com/Paymentbox-com/service-mesh-ruby), on
7
+ top of the `nats-pure` client.
8
+
9
+ The `ServiceMeshNats` module provides:
10
+ * `Client`, which implements the contract's `Client` over one NATS connection
11
+ * `Runtime`, which implements the contract's `Runtime` on a `Client`'s connection
12
+ * the configuration keys it reads
13
+ * the errors it defines
14
+
15
+ The contract types it works with, such as `ServiceMesh::Target`,
16
+ `ServiceMesh::Message`, `ServiceMesh::Endpoint`, and `ServiceMesh::Subscriber`,
17
+ come from the `service_mesh` gem.
7
18
 
8
19
  ## Install
9
20
 
@@ -12,7 +23,7 @@ This gem depends on the contract types and errors in [service-mesh-ruby](https:/
12
23
  gem "service_mesh_nats"
13
24
  ```
14
25
 
15
- Requires Ruby 3.3 or newer and a reachable NATS server. Depends on
26
+ Requires Ruby 3.3 or newer and a reachable NATS server. The gem depends on
16
27
  `service_mesh` and `nats-pure`.
17
28
 
18
29
  ## Usage
@@ -49,15 +60,14 @@ reply = client.request(ServiceMesh::Message.new(target: echo, payload: "hi"))
49
60
  client.publish(ServiceMesh::Message.new(target: created, payload: "order 42"))
50
61
  ```
51
62
 
52
- The client is the runtime's connection. `runtime.client` returns it, and
53
- `runtime.stop` closes it. A process that only requests and
54
- publishes builds a client itself and calls `close` when done.
55
- `runtime.service_map` and `client.service_map` return the map the client was
56
- built with.
63
+ The client is the runtime's connection. `runtime.client` returns it in every
64
+ state, and `runtime.stop` closes it. A process that only requests and publishes
65
+ builds a client itself and calls `close` when done. `runtime.service_map` and
66
+ `client.service_map` return the map the client was built with.
57
67
 
58
68
  ## Documentation
59
69
 
60
70
  - [Examples](docs/examples.md): a server process, a call-only client process, and consumer groups
61
- - [Public API](docs/public-api.md): the constants this gem exposes and how `Client` and `Runtime` behave
62
- - [What the NATS Runtime Decides](docs/runtime-behavior.md): targets, configuration, metadata, delivery, handler failure, timeouts, concurrency, lifecycle, and transport errors
71
+ - [Public API](docs/public-api.md): every public constant and method in `ServiceMeshNats`
72
+ - [Transport Specific Implementation](docs/transport-specific-implementation.md): subjects, configuration, metadata, delivery, handler failure, timeouts, concurrency, lifecycle, and errors
63
73
  - [Development](docs/development.md): the recipes and the tests
@@ -45,8 +45,8 @@ module ServiceMeshNats
45
45
  # Subscribes every binding on the client's connection and begins
46
46
  # receiving. Raises AlreadyStarted on a running runtime, Stopped after
47
47
  # stop, and Closed when the client has been closed. A failure while
48
- # subscribing closes the client, marks the runtime stopped, and passes
49
- # through.
48
+ # subscribing or flushing unsubscribes what was subscribed, leaves the
49
+ # runtime and the client as they were, and passes through.
50
50
  def start
51
51
  @lock.synchronize do
52
52
  raise AlreadyStarted if @state == :running
@@ -66,8 +66,6 @@ module ServiceMeshNats
66
66
  rescue => e
67
67
  subs.each { |s| s.unsubscribe rescue nil } # rubocop:disable Style/RescueModifier
68
68
  pool.kill
69
- @client.close
70
- @state = :stopped
71
69
  raise e
72
70
  end
73
71
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ServiceMeshNats
4
- VERSION = "0.5.1"
4
+ VERSION = "0.6.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: service_mesh_nats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryant Morrill