Skip to content

Commit

Permalink
Latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jlacivita committed Dec 13, 2023
1 parent 1adc6c9 commit d962b6c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions requirements/specifications/general/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Firebolt implementations **MUST** support all aspects of the JSON-RPC specificat

Firebolt implementations **MUST** send only one response for each request.

Firebolt implementations **MUST** treat all named OpenRPC fields, i.e. fields with a `"name"` attribute, as case-senstitive values, including, but not limited to methods and params.

**TODO**: Add note about case sensitivity

### 3.1. OpenRPC Documents
Expand Down Expand Up @@ -119,7 +121,7 @@ For standard JSON-RPC interactions, the module name is simply part of the method

Some Firebolt-specific OpenRPC extensions use the module name to refer to an entire group of methods within the module.

Firebolt OpenRPC allows one or zero module names, e.g. `Module.foo` and `foo` are valid method names, but `Module.Submodule.foo` is not.
Firebolt OpenRPC allows zero or more module names, e.g. `foo` and `Module.foo`, and `Module.Submodule.foo` are all valid method names.

### 3.3. Asynchronous Events
Asynchronous events, aka "notifications," **MUST** be handled by leveraging the common "duplex" pattern where both the Firebolt App & the Firebolt Implementation act as a JSON-RPC Server *and* a JSON-RPC client.
Expand Down Expand Up @@ -224,16 +226,13 @@ The Application OpenRPC definition for the notification **MUST** have an `x-even
}
],
"params": [
],
"result": {
"type": "void"
}
]
}
]
}
```

The notifer method **MUST** a result type of `void`, since no response is expected.
The notifer method **MUST** have no `"result"` defined, since no response is expected or allowed.

If an OpenRPC method tagged as a "notifier" does not have a `x-event` attribute on the tag, then the value **MUST** be generated by the Firebolt OpenRPC tooling to match the pattern: `<Module>.on<Method>`, e.g. a method named `Sky.sunrise` would have the `x-event` value set to `Sky.onSunrise`.

Expand Down Expand Up @@ -342,8 +341,8 @@ class myApp implements Lifecycle.IApplication, Lifecycle.IActivatable {

const app = new myApp()

Sky.provideSun(app)
Sky.provideSun(app)
Lifecycle.provideApplication(app)
Lifecycle.provideActivatable(app)
```
## 4. Transport
Expand All @@ -353,5 +352,5 @@ The RPC Protocol **MUST** be handled over a WebSocket.
The Firebolt API Version *and* protocol **MUST** be passsed as part of the Sec-WebSocket-Protocol header:
```http
Sec-WebSocket-Protocol: firebolt.v2.0.0, json-rpc
Sec-WebSocket-Protocol: firebolt.v2.0.0, jsonrpc
```

0 comments on commit d962b6c

Please sign in to comment.