20 lines
1.1 KiB
Markdown
20 lines
1.1 KiB
Markdown
# Angel3 Sync
|
|
|
|
[](https://pub.dev/packages/angel3_sync)
|
|
[](https://dart.dev/null-safety)
|
|
[](https://discord.gg/3X6bxTUdCM)
|
|
[](https://github.com/dart-backend/angel/tree/angel3/packages/sync/LICENSE)
|
|
|
|
Easily synchronize and scale WebSockets using [belatuk_pub_sub](<https://pub.dev/packages/belatuk_pub_sub>).
|
|
|
|
## Usage
|
|
|
|
This package exposes `PubSubSynchronizationChannel`, which can simply be dropped into any `AngelWebSocket` constructor. Once you've set that up, instances of your application will automatically fire events in-sync. That's all you have to do to scale a real-time application with Angel3!
|
|
|
|
```dart
|
|
await app.configure(AngelWebSocket(
|
|
synchronizationChannel: PubSubSynchronizationChannel(
|
|
pub_sub.IsolateClient('<client-id>', adapter.receivePort.sendPort),
|
|
),
|
|
));
|
|
```
|