platform/packages/sync/README.md

25 lines
1 KiB
Markdown
Raw Normal View History

2021-08-20 04:59:02 +00:00
# Angel3 Sync
2017-08-08 21:04:36 +00:00
2021-08-20 04:59:02 +00:00
[![version](https://img.shields.io/badge/pub-v4.0.0-brightgreen)](https://pub.dartlang.org/packages/angel3_sync)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
2017-08-08 21:04:36 +00:00
2021-08-20 04:59:02 +00:00
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/sync/LICENSE)
2017-08-08 21:04:36 +00:00
2021-08-20 04:59:02 +00:00
Easily synchronize and scale WebSockets using package:angel3_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
2017-08-08 21:04:36 +00:00
to scale a real-time application with Angel!
```dart
2021-08-20 04:59:02 +00:00
await app.configure(AngelWebSocket(
2018-11-15 17:42:41 +00:00
synchronizationChannel: new PubSubSynchronizationChannel(
2021-08-20 04:59:02 +00:00
pub_sub.IsolateClient('<client-id>', adapter.receivePort.sendPort),
2017-08-08 21:04:36 +00:00
),
));
2021-08-20 04:59:02 +00:00
```