Skip to content

Commit

Permalink
Rewrite the Realtime guide (#296)
Browse files Browse the repository at this point in the history
Rewrite the guide about the real-time engine
  • Loading branch information
Aschen authored Jun 5, 2019
1 parent 695fa40 commit 45d4f34
Show file tree
Hide file tree
Showing 16 changed files with 438 additions and 208 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ test/bin/*
dead_links.json
links_failed.json
.links_checked.json
.vscode
6 changes: 3 additions & 3 deletions src/core/1/api/essentials/notifications/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ The `result` object is the notification content, and it has the following struct

---

## User events
## User Notification

User notifications about users are triggered by the following events:
User notifications are triggered by the following events:

- A user subscribes to the same room
- A user leaves that room
Expand Down Expand Up @@ -138,7 +138,7 @@ The `result` object is the notification content, and it has the following struct

---

## Server events
## Server Notification

Server notifications are triggered by global events, and they are sent to all of a client's subscriptions at the same time.

Expand Down
4 changes: 2 additions & 2 deletions src/core/1/api/essentials/volatile-data/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ There is one special case, where volatile data are stored by Kuzzle for a later

Volatile data passed to a new subscription query are used two times by Kuzzle:

- if the new subscription triggers [user notifications](/core/1/api/essentials/notifications#user-events-default), its volatile data are included into those
- if that subscription is cancelled, whether because of a call to [realtime:unsubscribe](/core/1/api/controllers/realtime/unsubscribe/), or after the user disconnects: the volatile data provided **at the time of the subscription** are once again copied into user notifications triggered by that event
- if the new subscription triggers [user notifications](/core/1/api/essentials/notifications#user-notification-default), its volatile data are included into those
- if that subscription is cancelled, whether because of a call to [realtime:unsubscribe](/core/1/api/api-reference/controller-realtime/unsubscribe/), or after the user disconnects: the volatile data provided **at the time of the subscription** are once again copied into user notifications triggered by that event

This allows other real-time subscribers to get context information about a user joining or leaving the same subscription as them.

Expand Down
509 changes: 425 additions & 84 deletions src/core/1/guides/essentials/real-time/index.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/sdk/cpp/1/essentials/realtime-notifications/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ order: 100

# Notifications

The [realtime:subscribe](/sdk/cpp/1/controllers/realtime/) method takes a listener of type `kuzzleio::NotificationListener`.
The [realtime:subscribe](/sdk/cpp/1/controllers/realtime/) method takes a listener of type `kuzzleio::NotificationListener`.
That listener is called with a `const kuzzleio::notification_result*` argument, pointing to an object whose content depends on the type of notification received.

## Document & messages
Expand Down Expand Up @@ -38,7 +38,7 @@ The `kuzzleio::notification_content` struct has the following properties for doc

## User

These `kuzzleio::notification_result` represent [user events](/core/1/api/essentials/notifications#user-events-default).
These `kuzzleio::notification_result` represent [user events](/core/1/api/essentials/notifications#user-notification-default).

| Property | Type | Description |
| ------------ | ------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/go/1/essentials/realtime-notifications/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The `Result` property has the following structure for document notifications & m

## User

These notifications represent [user events](/core/1/api/essentials/notifications#user-events-default).
These notifications represent [user events](/core/1/api/essentials/notifications#user-notification-default).

| Property | Type | Description |
| ------------ | -------------------------- | ----------------------------------------------------------------------------------------------------- |
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/java/1/essentials/realtime-notifications/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ order: 100

# Notifications

The [Realtime.subscribe](/sdk/java/1/controllers/realtime/subscribe/) method takes a `io.kuzzle.sdk.NotificationListener` event listener (implements the `EventListener` interface).
The [Realtime.subscribe](/sdk/java/1/controllers/realtime/subscribe/) method takes a `io.kuzzle.sdk.NotificationListener` event listener (implements the `EventListener` interface).
That listener is fed with a `io.kuzzle.sdk.NotificationResult` object, whose content depends on the type of notification.

Properties can be accessed with usual getters and setters.
Expand Down Expand Up @@ -40,7 +40,7 @@ The `io.kuzzle.sdk.NotificationContent` object has the following properties for

## User

These `io.kuzzle.sdk.NotificationResult` represent [user events](/core/1/api/essentials/notifications#user-events-default).
These `io.kuzzle.sdk.NotificationResult` represent [user events](/core/1/api/essentials/notifications#user-notification-default).

| Property | Type | Description |
| ------------ | --------------------------------- | ----------------------------------------------------------------------------------------------------- |
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/js/6/essentials/realtime-notifications/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The `result` object is the notification content, and it has the following struct

## User

These notifications represent [user events](/core/1/api/essentials/notifications#user-events-default).
These notifications represent [user events](/core/1/api/essentials/notifications#user-notification-default).

| Property | Type | Description |
| ------------ | ----------------- | ----------------------------------------------------------------------------------------------------- |
Expand All @@ -61,7 +61,7 @@ The `result` object is the notification content, and it has the following struct

## Server

These notifications represent [server events](/core/1/api/essentials/notifications#server-events-default).
These notifications represent [server events](/core/1/api/essentials/notifications#server-notification-default).

| Property | Type | Value |
| --------- | ----------------- | ------------------------------------------------------------------ |
Expand Down

0 comments on commit 45d4f34

Please sign in to comment.