Updated sync

This commit is contained in:
thomashii 2021-09-12 10:52:19 +08:00
parent 96ea1b1611
commit b463568988
9 changed files with 44 additions and 47 deletions

View file

@ -1,13 +0,0 @@
# See https://www.dartlang.org/tools/private-files.html
# Files and directories created by pub
.packages
.pub/
build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock
# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
.dart_tool

View file

@ -1,5 +1,10 @@
# Change Log # Change Log
## 4.1.0
* Updated to use `belatuk_pub_sub` package
* Upgraded from `pendantic` to `lints` linter
## 4.0.0 ## 4.0.0
* Updated to use `angel3` packages * Updated to use `angel3` packages

View file

@ -1,21 +1,29 @@
MIT License BSD 3-Clause License
Copyright (c) 2021 dukefirehawk.com Copyright (c) 2021, dukefirehawk.com
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy Redistribution and use in source and binary forms, with or without
of this software and associated documentation files (the "Software"), to deal modification, are permitted provided that the following conditions are met:
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all 1. Redistributions of source code must retain the above copyright notice, this
copies or substantial portions of the Software. list of conditions and the following disclaimer.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 2. Redistributions in binary form must reproduce the above copyright notice,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, this list of conditions and the following disclaimer in the documentation
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE and/or other materials provided with the distribution.
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 3. Neither the name of the copyright holder nor the names of its
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE contributors may be used to endorse or promote products derived from
SOFTWARE. this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -1,23 +1,23 @@
# Angel3 Sync # Angel3 Sync
[![version](https://img.shields.io/badge/pub-v4.0.0-brightgreen)](https://pub.dartlang.org/packages/angel3_sync) [![version](https://img.shields.io/badge/pub-v4.1.0-brightgreen)](https://pub.dev/packages/angel3_sync)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![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) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/sync/LICENSE) [![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/sync/LICENSE)
Easily synchronize and scale WebSockets using package:angel3_pub_sub. Easily synchronize and scale WebSockets using package:belatuk_pub_sub.
## Usage ## Usage
This package exposes `PubSubSynchronizationChannel`, which can simply be dropped into any `AngelWebSocket` constructor. 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 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 Angel! to scale a real-time application with Angel3!
```dart ```dart
await app.configure(AngelWebSocket( await app.configure(AngelWebSocket(
synchronizationChannel: new PubSubSynchronizationChannel( synchronizationChannel: PubSubSynchronizationChannel(
pub_sub.IsolateClient('<client-id>', adapter.receivePort.sendPort), pub_sub.IsolateClient('<client-id>', adapter.receivePort.sendPort),
), ),
)); ));

View file

@ -1,4 +1 @@
include: package:pedantic/analysis_options.yaml include: package:lints/recommended.yaml
analyzer:
strong-mode:
implicit-casts: false

View file

@ -5,8 +5,8 @@ import 'package:angel3_sync/angel3_sync.dart';
import 'package:angel3_test/angel3_test.dart'; import 'package:angel3_test/angel3_test.dart';
import 'package:angel3_websocket/io.dart' as client; import 'package:angel3_websocket/io.dart' as client;
import 'package:angel3_websocket/server.dart'; import 'package:angel3_websocket/server.dart';
import 'package:angel3_pub_sub/isolate.dart' as pub_sub; import 'package:belatuk_pub_sub/isolate.dart' as pub_sub;
import 'package:angel3_pub_sub/angel3_pub_sub.dart' as pub_sub; import 'package:belatuk_pub_sub/belatuk_pub_sub.dart' as pub_sub;
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {

View file

@ -1,6 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:angel3_websocket/angel3_websocket.dart'; import 'package:angel3_websocket/angel3_websocket.dart';
import 'package:angel3_pub_sub/angel3_pub_sub.dart' as pub_sub; import 'package:belatuk_pub_sub/belatuk_pub_sub.dart' as pub_sub;
import 'package:stream_channel/stream_channel.dart'; import 'package:stream_channel/stream_channel.dart';
/// Synchronizes WebSockets using `package:pub_sub`. /// Synchronizes WebSockets using `package:pub_sub`.

View file

@ -1,6 +1,6 @@
name: angel3_sync name: angel3_sync
version: 4.0.0 version: 4.1.0
description: Easily synchronize and scale WebSockets using package:angel3_pub_sub for Angel3. description: Easily synchronize and scale WebSockets using belatuk_pub_sub in Angel3.
homepage: https://angel3-framework.web.app/ homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/sync repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/sync
environment: environment:
@ -8,9 +8,9 @@ environment:
dependencies: dependencies:
angel3_framework: ^4.1.0 angel3_framework: ^4.1.0
angel3_websocket: ^4.0.0 angel3_websocket: ^4.0.0
angel3_pub_sub: ^3.0.0 belatuk_pub_sub: ^4.0.0
stream_channel: ^2.1.0 stream_channel: ^2.1.0
dev_dependencies: dev_dependencies:
angel3_test: ^4.0.0 angel3_test: ^4.0.0
test: ^1.17.8 test: ^1.17.8
pedantic: ^1.11.1 lints: ^1.0.0

View file

@ -5,8 +5,8 @@ import 'package:angel3_sync/angel3_sync.dart';
import 'package:angel3_test/angel3_test.dart'; import 'package:angel3_test/angel3_test.dart';
import 'package:angel3_websocket/io.dart' as client; import 'package:angel3_websocket/io.dart' as client;
import 'package:angel3_websocket/server.dart'; import 'package:angel3_websocket/server.dart';
import 'package:angel3_pub_sub/isolate.dart' as pub_sub; import 'package:belatuk_pub_sub/isolate.dart' as pub_sub;
import 'package:angel3_pub_sub/angel3_pub_sub.dart' as pub_sub; import 'package:belatuk_pub_sub/belatuk_pub_sub.dart' as pub_sub;
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {