Skip to content

Commit

Permalink
fixes for the spec and observed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegDokuka committed Aug 25, 2020
1 parent 7fb802c commit d791254
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
7 changes: 4 additions & 3 deletions Extensions/Leasing/ConcurrencyLimitLeasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ TODO
+-----------+-+-+---------------+-------------------------------+
|Frame Type |0|M| Flags |
+-----------+-+-+---------------+-------------------------------+
|0| Time-To-Live |
+---------------------------------------------------------------+
|0| Concurrency Limit |
+ +
| |
+---------------------------------------------------------------+
Metadata
```

* __Frame Type__: (6 bits) 0x02
* __Flags__: (10 bits)
* (__M__)etadata: Metadata present
* __Concurrency Limit__: (63 bits = max value 2^63-1 = 9,223,372,036,854,775,807) Unsigned 63-bit long of Number of Max Concurrent Requests at a time. Value MUST be >= 0.
* __Time-To-Live (TTL)__: (31 bits = max value 2^31-1 = 2,147,483,647) Unsigned 31-bit integer of Time (in milliseconds) for validity of LEASE from time of reception. Value MUST be > 0.
* __Concurrency Limit__: (63 bits = max value 2^31-1 = 2,147,483,647) Unsigned 31-bit long of Number of Max Concurrent Requests at a time. Value MUST be >= 0.

A Responder implementation MAY stop all further requests by sending a LEASE with a value of 0 for __Concurrency Limit__.

Expand Down
4 changes: 2 additions & 2 deletions Extensions/Leasing/FramesCountLeasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ TODO
* __Frame Type__: (6 bits) 0x02
* __Flags__: (10 bits)
* (__M__)etadata: Metadata present
* __Time-To-Live (TTL)__: (31 bits = max value 2^31-1 = 2,147,483,647) Unsigned 31-bit integer of Time (in milliseconds) for validity of LEASE from time of reception. Value MUST be >= 0.
* __Time-To-Live (TTL)__: (31 bits = max value 2^31-1 = 2,147,483,647) Unsigned 31-bit integer of Time (in milliseconds) for validity of LEASE from time of reception. Value MUST be > 0.
* __Number of Frames__: (31 bits = max value 2^31-1 = 2,147,483,647) Unsigned 31-bit integer of Number of Frames that may be sent until next LEASE. Value MUST be >= 0.

A Responder implementation MAY stop all further frames by sending a LEASE with a value of 0 for __Number of Frames__ or __Time-To-Live__.
A Responder implementation MAY stop all further frames by sending a LEASE with a value of 0 for __Number of Frames__.

When a LEASE expires due to time, the value of the __Number of Frames__ that a Requester may make is implicitly 0.

Expand Down
12 changes: 6 additions & 6 deletions Extensions/Leasing/Leasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
_This extension specification is currently incubating. While incubating the version is 0._

## Introduction
When two system are communicating via RSocket, it is crucial to provide a way of preserving systems stability. Even though the Leasing specification brings such an oportunity, it is not always possible to use the same strategy for leasing in order to make communication stable. This extension specification provides a way to specify by a `Client` using [`CompositeMedata`][cm] a set of Leasing strategies so the `Server` can choose one of them depends on the requirements and respond.
When two systems are communicating via RSocket, it is crucial to provide a way of preserving systems stability. Even though the Leasing specification brings such an opportunity, it is not always possible to use the same strategy for leasing in order to make communication stable. This extension specification provides a way to specify by a `Client` using [`CompositeMedata`][cm] a set of Leasing strategies so the `Server` can choose one of them depends on the requirements and then respond as defined in the [negotiation](#negotiation) section.

## Metadata Payload
This metadata type is intended to be used per connection, and not per stream nor individual payloads and as such it **MUST** only be used in the [`SETUP`][sf] frame type. The Metadata MIME Type is `message/x.rsocket.supported-lease-strategies.v0`.
This metadata type is intended to be used per connection, and not per stream, nor individual payloads, and as such it **MUST** only be used in the [`SETUP`][sf] frame type. The Metadata MIME Type is `message/x.rsocket.supported-lease-strategies.v0`.

[sf]: ../../Protocol.md#frame-setup

Expand All @@ -29,9 +29,9 @@ This metadata type is intended to be used per connection, and not per stream nor
[wk]: WellKnownLeaseStrategies.md


## Negotitation
## Negotiation

Once a `Client` specified [supported lease strategies](#metadata-payload), the `Server` MUST select one of the provided supported lease strategies or reject if none of the provided are supported. In turn, to encode the selected lease strategy, `Server` MUST use the medata field of the `LEASE`:
Once a `Client` specified [supported lease strategies](#metadata-payload), the `Server` MUST select one of the provided supported lease strategies or reject if none of the provided are supported. In turn, to encode the selected lease strategy, `Server` MUST use the metadata field of the `LEASE`:

### Metadata Contents
```
Expand All @@ -42,13 +42,13 @@ Once a `Client` specified [supported lease strategies](#metadata-payload), the `
+---------------+---------------+---------------+---------------+
```

* (**L**)Lease Strategy: Lease strategyype is a well known value represented by a unique integer. If L flag is set (a value of `1`), indicates a [Well-known Strategy Type ID][wk]. If L flag is not set (a value of `0`), indicates the Lease Strategy Length in bytes.
* (**L**)Lease Strategy: Lease strategy is a well known value represented by a unique integer. If L flag is set (a value of `1`), indicates a [Well-known Strategy Type ID][wk]. If L flag is not set (a value of `0`), indicates the Lease Strategy Length in bytes.
* **Lease Strategy ID/Length**: (7 bits = max value 2^7 = 128) Unsigned 7-bit integer. If L flag is set (a value of `1`), indicates a [Well-known Strategy Type ID][wk]. If A flag is not set (a value of `0`), indicates the Lease Strategy Length in bytes.
* **Lease Strategy**: the strategy for leasing. This SHOULD be a US-ASCII string. The string MUST NOT be null terminated. (Not present if L flag is set)

[wk]: WellKnownLeaseStrategies.md

Note, if the selected lease strategy has a different frame layout than the deafult one, the first [`LEASE`][lf] frame MUST follow the default [`LEASE`][lf] frame layout, in order to let the `Client` read metadata field content
Note, if the selected lease strategy has a different frame layout than the default one, the first [`LEASE`][lf] frame MUST follow the default [`LEASE`][lf] frame layout, in order to let the `Client` read metadata field content


[lf]: ../../Protocol.md#frame-lease
4 changes: 2 additions & 2 deletions Protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,10 @@ Frame Contents
* __Frame Type__: (6 bits) 0x02
* __Flags__: (10 bits)
* (__M__)etadata: Metadata present
* __Time-To-Live (TTL)__: (31 bits = max value 2^31-1 = 2,147,483,647) Unsigned 31-bit integer of Time (in milliseconds) for validity of LEASE from time of reception. Value MUST be >= 0.
* __Time-To-Live (TTL)__: (31 bits = max value 2^31-1 = 2,147,483,647) Unsigned 31-bit integer of Time (in milliseconds) for validity of LEASE from time of reception. Value MUST be > 0.
* __Number of Requests__: (31 bits = max value 2^31-1 = 2,147,483,647) Unsigned 31-bit integer of Number of Requests that may be sent until next LEASE. Value MUST be >= 0.

A Responder implementation MAY stop all further requests by sending a LEASE with a value of 0 for __Number of Requests__ or __Time-To-Live__.
A Responder implementation MAY stop all further requests by sending a LEASE with a value of 0 for __Number of Requests__.

When a LEASE expires due to time, the value of the __Number of Requests__ that a Requester may make is implicitly 0.

Expand Down

0 comments on commit d791254

Please sign in to comment.