0.24.0-alpha.0 • Published 13 days ago

@toa.io/extensions.realtime v0.24.0-alpha.0

Weekly downloads
-
License
-
Repository
github
Last release
13 days ago

Toa Realtime

Overview

Realtime extension combines application events into streams according to defined routes. Clients may consume these streams via Exposition.

Static routes

Static route specifies an event that should be combined into a stream using specified property of event's payload as a stream key.

Static routes may be defined in Component manifest or the Context annotation.

# manifest.toa.yaml
name: users

realtime:
  updated: id
# context.toa.yaml
realtime:
  users.updated: id
  orders.created: custromer_id

In case of conflict, the Context annotation takes precedence.

Static route examples

Given two rules: users.updated: id and orders.created: customer_id, the following events will be routed into a stream with a4b8e7e8 key:

# users.updated
id: a4b8e7e8 # id property is used as a stream key
name: John Doe
# orders.created
id: 1
customer_id: a4b8e7e8 # customer_id property is used as a stream key
amount: 100

Dynamic routes

Not implemented

Dynamic routes address the cases when a stream key is not a property of an event.

Among with an event and a stream key, a dynamic route has property and value properties, which define a condition that should be met for an event to be combined into a stream with the specified key.

Dynamic route example

For instance, when there are chat rooms with a list of users, and a user joins or leaves the room. When a message is sent to a room, an event will have a room_id property, but not a user_id. In this case, when the user a4b8e7e8 enters the room with id general, a dynamic route may be created as follows:

event: message.sent
property: room_id
value: general
stream: a4b8e7e8

Each time the message is sent to the room with id general, the event will be routed into a stream with a4b8e7e8 key.

Managing dynamic routes

Dynamic routes are managed by the realtime.routes component, running in the Realtime extension.

Exposition

Streams are exposed by the realtime.streams component, running in the Realtime extension, and are accessible via the /realtime/streams/:key/ resource with the auth:id: key authorization rule.

Refer to the Exposition extension for more details:

1.0.0-alpha.34

13 days ago

1.0.0-alpha.33

13 days ago

1.0.0-alpha.36

13 days ago

1.0.0-alpha.35

13 days ago

1.0.0-alpha.32

15 days ago

1.0.0-alpha.29

18 days ago

1.0.0-alpha.30

18 days ago

1.0.0-alpha.31

17 days ago

1.0.0-alpha.27

23 days ago

1.0.0-alpha.28

23 days ago

1.0.0-alpha.26

1 month ago

1.0.0-alpha.25

1 month ago

1.0.0-alpha.24

2 months ago

1.0.0-alpha.23

2 months ago

1.0.0-alpha.22

2 months ago

1.0.0-alpha.21

2 months ago

1.0.0-alpha.20

2 months ago

1.0.0-alpha.19

2 months ago

1.0.0-alpha.18

2 months ago

1.0.0-alpha.17

2 months ago

1.0.0-alpha.16

2 months ago

1.0.0-alpha.15

2 months ago

1.0.0-alpha.14

2 months ago

1.0.0-alpha.13

2 months ago

1.0.0-alpha.12

3 months ago

1.0.0-alpha.10

3 months ago

1.0.0-alpha.11

3 months ago

1.0.0-alpha.9

3 months ago

1.0.0-alpha.8

3 months ago

1.0.0-alpha.7

3 months ago

1.0.0-alpha.6

3 months ago

1.0.0-alpha.5

3 months ago

1.0.0-alpha.4

3 months ago

1.0.0-alpha.3

3 months ago

0.24.0-alpha.23

3 months ago

1.0.0-alpha.2

3 months ago

0.24.0-alpha.22

3 months ago

0.24.0-alpha.21

3 months ago

0.24.0-alpha.20

3 months ago

0.24.0-alpha.19

3 months ago

0.24.0-alpha.16

6 months ago

0.24.0-alpha.17

5 months ago

0.24.0-alpha.18

5 months ago

0.24.0-alpha.15

6 months ago

0.24.0-alpha.13

6 months ago

0.24.0-alpha.14

6 months ago

0.24.0-alpha.12

6 months ago

0.24.0-alpha.11

6 months ago

0.24.0-alpha.10

6 months ago

0.24.0-alpha.9

6 months ago

0.24.0-alpha.8

6 months ago

0.24.0-alpha.7

6 months ago

0.24.0-alpha.6

6 months ago

0.24.0-alpha.5

6 months ago

0.24.0-alpha.4

6 months ago

0.24.0-alpha.3

6 months ago

0.24.0-alpha.2

6 months ago

0.24.0-alpha.0

6 months ago

1.0.0-alpha.0

6 months ago

0.23.0-dev.0

7 months ago

0.22.1

7 months ago

0.22.0

7 months ago

0.1.0-alpha.0

7 months ago

0.0.0

7 months ago

0.0.0-alpha.2

7 months ago