Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit a444e3b

Browse files
committed
Update documentation:
- Add new section on namespace context 'n' and sequence number fields 's'. - Clarify 's' as crucial for guaranteed, ordered delivery in gateway events.
1 parent d79c49f commit a444e3b

File tree

1 file changed

+10
-9
lines changed
  • docs/Protocol Specifications

1 file changed

+10
-9
lines changed

docs/Protocol Specifications/core.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,15 @@ on the specific event.
246246
| `n` | string | [Namespace](#82-namespaces) context for this payload. |
247247
| `op` | uint16 | Gateway Opcode indicating the type of payload. |
248248
| `d` | JSON value | The event data associated with this payload. |
249-
| `s` | uint64 | Sequence number of the event, used for guaranteed, ordered delivery |
249+
| `s`¹ | uint64 | Sequence number of the event, used for guaranteed, ordered delivery |
250+
251+
¹: This field is only received by clients and never sent to the server.
250252

251253
##### 3.2.1.1 Namespaces `n`
252254

253255
The `n` field in a gateway event payload indicates the namespace context for the payload. You can
254256
read more about namespaces in [section 8.2](#82-namespaces).
255-
257+
messages
256258
Every namespace may define its own set of opcodes and event names.
257259

258260
The namespace context must be known to the entity receiving the payload, as it is crucial for
@@ -355,8 +357,7 @@ A service channel event payload has the following structure:
355357
"d": {
356358
"action": "subscribe",
357359
"service": "service_name"
358-
},
359-
"s": 1
360+
}
360361
}
361362
```
362363

@@ -521,11 +522,11 @@ $$
521522
}
522523
```
523524

524-
| Field | Type | Description |
525-
| -------- | ------------- | -------------------------------------------------------------------------------------------------------------------------- |
526-
| `from` | string | The lowest sequence number received this heartbeat interval |
527-
| `to` | string | The highest sequence number received this heartbeat interval |
528-
| `except` | array[string] | Sequence numbers `x`, where \{$x \in \mathbb{N} \mid from\leq x\leq to\}$, that were not received this heartbeat interval. |
525+
| Field | Type | Description |
526+
| -------- | -------------- | -------------------------------------------------------------------------------------------------------------------------- |
527+
| `from` | string | The lowest sequence number received this heartbeat interval |
528+
| `to` | string | The highest sequence number received this heartbeat interval |
529+
| `except` | array[string]? | Sequence numbers `x`, where \{$x \in \mathbb{N} \mid from\leq x\leq to\}$, that were not received this heartbeat interval. |
529530

530531
!!! example "Example heartbeat event payload"
531532

0 commit comments

Comments
 (0)