Updated sync
This commit is contained in:
parent
96ea1b1611
commit
b463568988
9 changed files with 44 additions and 47 deletions
13
packages/sync/.gitignore
vendored
13
packages/sync/.gitignore
vendored
|
@ -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
|
|
@ -1,5 +1,10 @@
|
|||
# Change Log
|
||||
|
||||
## 4.1.0
|
||||
|
||||
* Updated to use `belatuk_pub_sub` package
|
||||
* Upgraded from `pendantic` to `lints` linter
|
||||
|
||||
## 4.0.0
|
||||
|
||||
* Updated to use `angel3` packages
|
||||
|
|
|
@ -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
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
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:
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
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.
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
# 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)
|
||||
[![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)
|
||||
|
||||
Easily synchronize and scale WebSockets using package:angel3_pub_sub.
|
||||
Easily synchronize and scale WebSockets using package: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 Angel!
|
||||
to scale a real-time application with Angel3!
|
||||
|
||||
```dart
|
||||
await app.configure(AngelWebSocket(
|
||||
synchronizationChannel: new PubSubSynchronizationChannel(
|
||||
synchronizationChannel: PubSubSynchronizationChannel(
|
||||
pub_sub.IsolateClient('<client-id>', adapter.receivePort.sendPort),
|
||||
),
|
||||
));
|
||||
|
|
|
@ -1,4 +1 @@
|
|||
include: package:pedantic/analysis_options.yaml
|
||||
analyzer:
|
||||
strong-mode:
|
||||
implicit-casts: false
|
||||
include: package:lints/recommended.yaml
|
|
@ -5,8 +5,8 @@ import 'package:angel3_sync/angel3_sync.dart';
|
|||
import 'package:angel3_test/angel3_test.dart';
|
||||
import 'package:angel3_websocket/io.dart' as client;
|
||||
import 'package:angel3_websocket/server.dart';
|
||||
import 'package:angel3_pub_sub/isolate.dart' as pub_sub;
|
||||
import 'package:angel3_pub_sub/angel3_pub_sub.dart' as pub_sub;
|
||||
import 'package:belatuk_pub_sub/isolate.dart' as pub_sub;
|
||||
import 'package:belatuk_pub_sub/belatuk_pub_sub.dart' as pub_sub;
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'dart:async';
|
||||
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';
|
||||
|
||||
/// Synchronizes WebSockets using `package:pub_sub`.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: angel3_sync
|
||||
version: 4.0.0
|
||||
description: Easily synchronize and scale WebSockets using package:angel3_pub_sub for Angel3.
|
||||
version: 4.1.0
|
||||
description: Easily synchronize and scale WebSockets using belatuk_pub_sub in Angel3.
|
||||
homepage: https://angel3-framework.web.app/
|
||||
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/sync
|
||||
environment:
|
||||
|
@ -8,9 +8,9 @@ environment:
|
|||
dependencies:
|
||||
angel3_framework: ^4.1.0
|
||||
angel3_websocket: ^4.0.0
|
||||
angel3_pub_sub: ^3.0.0
|
||||
belatuk_pub_sub: ^4.0.0
|
||||
stream_channel: ^2.1.0
|
||||
dev_dependencies:
|
||||
angel3_test: ^4.0.0
|
||||
test: ^1.17.8
|
||||
pedantic: ^1.11.1
|
||||
lints: ^1.0.0
|
|
@ -5,8 +5,8 @@ import 'package:angel3_sync/angel3_sync.dart';
|
|||
import 'package:angel3_test/angel3_test.dart';
|
||||
import 'package:angel3_websocket/io.dart' as client;
|
||||
import 'package:angel3_websocket/server.dart';
|
||||
import 'package:angel3_pub_sub/isolate.dart' as pub_sub;
|
||||
import 'package:angel3_pub_sub/angel3_pub_sub.dart' as pub_sub;
|
||||
import 'package:belatuk_pub_sub/isolate.dart' as pub_sub;
|
||||
import 'package:belatuk_pub_sub/belatuk_pub_sub.dart' as pub_sub;
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
|
|
Loading…
Reference in a new issue