angel_multiserver 1.0.9

  • README.md
  • Installing
  • Versions
  • 65

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]
55
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
39
Overall:
Weighted score of the above. [more]
65
Learn more about scoring.

We analyzed this package on Aug 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0
  • pana: 0.11.8

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

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

Fix platform conflicts.

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Maintain CHANGELOG.md.

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

Package is getting outdated.

The package was released 72 weeks ago.

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.

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.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/synchronizers/memcached.dart (Run dartfmt to format lib/src/synchronizers/memcached.dart.)
  • lib/src/synchronizers/mongo.dart (Run dartfmt to format lib/src/synchronizers/mongo.dart.)
  • lib/src/synchronizers/synchronizers.dart (Run dartfmt to format lib/src/synchronizers/synchronizers.dart.)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0