You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Custom Server: A custom websocket server implementation can be provided via `cds.websocket.impl`
132
+
-**Custom Server**: A custom websocket server implementation can be provided via a path relative to the project root
133
+
with the configuration `cds.websocket.impl` (e.g. `cds.websocket.impl: './server/xyz.js'`).
133
134
134
135
The server implementation abstracts from the concrete websocket implementation. The websocket client still needs to be implemented websocket implementation specific.
135
136
@@ -521,14 +522,15 @@ To configure the PCP message format the following annotations are available:
521
522
522
523
#### Custom Format
523
524
524
-
A custom websocket format implementation can be provided via a relative path in `@websocket.format` resp. `@ws.format` annotation.
525
+
A custom websocket format implementation can be provided via a path relative to the project root
526
+
in `@websocket.format` resp. `@ws.format` annotation (e.g. `@ws.format: './format/xyz.js'`).
525
527
526
528
The custom format class needs to implement the following functions:
527
529
528
530
- **parse(data)**: Parse the event data into internal data (JSON), i.e. `{ event, data }`
529
531
- **compose(event, data)**: Compose the event and internal data (JSON) into a formatted string. For kind `socket.io`, it can also be a JSON object.
530
532
531
-
In addition, it can implement the following class functions (optional):
533
+
In addition, it can implement the following functions (optional):
532
534
533
535
- **constructor(service)**: Setup instance with service definition on creation
534
536
@@ -818,14 +820,15 @@ To use the Redis Adapter (basic publish/subscribe), the following steps have to
818
820
819
821
###### Custom Adapter
820
822
821
-
A custom websocket adapter implementation can be provided via relative path set configuration of `cds.websocket.adapter.impl`.
823
+
A custom websocket adapter implementation can be provided via a path relative to the project root
824
+
with the configuration `cds.websocket.adapter.impl` (e.g. `cds.websocket.adapter.impl: './adapter/xyz.js'`).
822
825
823
826
The custom adapter class needs to implement the following functions:
824
827
825
828
- **on(service, path)**: Register an adapter subscription
826
829
- **emit(service, path, message)**: Emit an adapter event message
827
830
828
-
In addition, it can implement the following class functions (optional):
831
+
In addition, it can implement the following functions (optional):
829
832
830
833
- **constructor(server, config)**: Setup instance on creation
831
834
- **setup()**: Perform some async setup activities (optional)
0 commit comments