angel_multiserver 1.0.9

  • README.md
  • Installing
  • Versions
  • 11

multiserver

Support for running Dart applications, specifically Angel apps, across multiple servers.

The idea is that you have one master server running the load balancer, and the child applications call a session synchronizer.

Dedicated WebSocket support is also present.

See the examples.

Response Caching

This plug-in works on any Angel server, not just a LoadBalancer. It caches responses, to lower future response times.

Load Balancing

This package exposes a LoadBalancer class, which extends Angel, and can be used like a normal server.

The default algorithm is a simple round-robin, but it can be extended for your own purposes.

Three load-balancing algorithms are included:

  • ROUND_ROBIN (default)
  • LEAST_LATENCY
  • STICKY_SESSION

The LoadBalancer also supports HTTPS and WebSockets. Bam.

You can also provide a maxConcurrentConnections to pool server resources and prevent premature crashes.

Session Synchronization

This package also includes three SessionSynchronizer classes:

  • MongoDB
  • Memcached
  • Redis

These are simply plugins that serialize and deserialize session data to external data stores. Try to call them as early as possible in your application, so that session data is loaded before any business logic.

import 'package:angel_framework/angel_framework.dart';
import 'package:angel_multiserver/angel_multiserver.dart';
import 'package:mongo_dart/mongo_dart.dart';

main() async {
    var app = new Angel();
    var db = new Db('<connection-string>');
    await db.open();
    await app.configure(
        new MongoSessionSynchronizer(db.collection('sessions')));
}

WebSocket Synchronization

The multiserver is also bundled with a MongoWebSocketSynchronizer.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  angel_multiserver: ^1.0.9

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:angel_multiserver/angel_multiserver.dart';
  
Version Uploaded Documentation Archive
1.0.9 Mar 28, 2017 Go to the documentation of angel_multiserver 1.0.9 Download angel_multiserver 1.0.9 archive
1.0.8 Mar 7, 2017 Go to the documentation of angel_multiserver 1.0.8 Download angel_multiserver 1.0.8 archive
1.0.7 Mar 6, 2017 Go to the documentation of angel_multiserver 1.0.7 Download angel_multiserver 1.0.7 archive
1.0.6 Feb 28, 2017 Go to the documentation of angel_multiserver 1.0.6 Download angel_multiserver 1.0.6 archive
1.0.5 Feb 27, 2017 Go to the documentation of angel_multiserver 1.0.5 Download angel_multiserver 1.0.5 archive
1.0.4 Feb 26, 2017 Go to the documentation of angel_multiserver 1.0.4 Download angel_multiserver 1.0.4 archive
1.0.3 Feb 26, 2017 Go to the documentation of angel_multiserver 1.0.3 Download angel_multiserver 1.0.3 archive
1.0.2 Feb 26, 2017 Go to the documentation of angel_multiserver 1.0.2 Download angel_multiserver 1.0.2 archive
1.0.1 Feb 26, 2017 Go to the documentation of angel_multiserver 1.0.1 Download angel_multiserver 1.0.1 archive
1.0.0 Feb 24, 2017 Go to the documentation of angel_multiserver 1.0.0 Download angel_multiserver 1.0.0 archive

All 15 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
22
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
11
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.1.0.
 
 Because angel_multiserver depends on redis_client >=0.1.4-dev which requires SDK version <2.0.0, version solving failed.

Health suggestions

Format lib/src/algorithm.dart.

Run dartfmt to format lib/src/algorithm.dart.

Format lib/src/load_balancer.dart.

Run dartfmt to format lib/src/load_balancer.dart.

Format lib/src/synchronizers/memcached.dart.

Run dartfmt to format lib/src/synchronizers/memcached.dart.

Format lib/src/synchronizers/mongo.dart.

Run dartfmt to format lib/src/synchronizers/mongo.dart.

Format lib/src/synchronizers/synchronizers.dart.

Run dartfmt to format lib/src/synchronizers/synchronizers.dart.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Maintain CHANGELOG.md. (-20 points)

Changelog entries help clients to follow the progress in your code.

Package is getting outdated. (-71.51 points)

The package was released 89 weeks ago.

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use angel_multiserver.dart. Packages with multiple examples should use example/readme.md.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0