switchboard 2.0.11

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 71

Switchboard #

Microservice communication protocol.

Frames #

The base connection is any framed messaging protocol. The current WSTalk2 protocol target is WebSockets since it's ubiquitously available everywhere.

Channels #

The message frame connection is multiplexed into channels for arbitrary usage. Both sides of the connection can arbitrarily open new channels. When opening a channel, an arbitrary payload blob is included for the application to interpret and process. The payload can be used for authentication, identification, and addressing purposes.

These multiplexed channels are effectively a framed messaging protocol, and technically can be recursively multiplexed into more channels.

An entire channel can be transparantly proxied to another host without parsing it's contents.

Message Chain #

The message chain protocol is defined to run on top of any framed messaging protocol. This is similar to an RPC protocol, but rather than being purely request-response, each message can be a response to a previous message, and multiple messages can be sent as a response to form a streamed response. The message chain can recursively respond with streams to individual stream responses, and so on.

An entire message chain starting from any message can be transparantly proxied to another host without parsing it's contents.

Usage #


Future Plans #

Redesign to target both QUIC and WebSockets as primary transport layers.

2.0.6 #

  • Don't reset payload if identical.

2.0.5 #

  • Fix issue reconnecting after previous error.

2.0.4 #

  • Rebranding
  • Rewrite from scratch with simplified interface.
  • Support channels for allowing virtual services or protocols on the same host (virtual hosts, etc.)

1.3.3 #

  • Can now request for streams. Stream responses can recursively be requests as well.

1.2.1 #

  • Request messages can be replied to with an exception using sendException.
  • Request message timeout can be extended through the sendExtend function.
  • Formatted source.
  • Fixed some minor issues.

0.9.3 #

  • Initial version.

Use this package as a library

1. Depend on it

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


dependencies:
  switchboard: ^2.0.11

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:switchboard/switchboard.dart';
  
Version Uploaded Documentation Archive
2.0.11 Dec 17, 2018 Go to the documentation of switchboard 2.0.11 Download switchboard 2.0.11 archive
2.0.10 Dec 16, 2018 Go to the documentation of switchboard 2.0.10 Download switchboard 2.0.10 archive
2.0.9 Dec 4, 2018 Go to the documentation of switchboard 2.0.9 Download switchboard 2.0.9 archive
2.0.8 Dec 4, 2018 Go to the documentation of switchboard 2.0.8 Download switchboard 2.0.8 archive
2.0.7 Dec 4, 2018 Go to the documentation of switchboard 2.0.7 Download switchboard 2.0.7 archive
2.0.5 Nov 25, 2018 Go to the documentation of switchboard 2.0.5 Download switchboard 2.0.5 archive
2.0.4 Nov 25, 2018 Go to the documentation of switchboard 2.0.4 Download switchboard 2.0.4 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
56
Health:
Code health derived from static analysis. [more]
96
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
73
Overall:
Weighted score of the above. [more]
71
Learn more about scoring.

We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13

Platforms

Detected platforms: Flutter, other

Primary library: package:switchboard/switchboard.dart with components: io.

Health suggestions

Fix lib/src/switchboard.dart. (-3.93 points)

Analysis of lib/src/switchboard.dart reported 8 hints, including:

line 171 col 10: The value of the field '_discoveryService' isn't used.

line 194 col 31: Use = to separate a named parameter from its default value.

line 218 col 60: Use = to separate a named parameter from its default value.

line 239 col 65: Use = to separate a named parameter from its default value.

line 414 col 11: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Fix lib/src/talk_channel.dart. (-0.50 points)

Analysis of lib/src/talk_channel.dart reported 1 hint:

line 270 col 19: Use isNotEmpty instead of length

Format lib/src/mux_connection_impl.dart.

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

Maintenance suggestions

The package description is too short. (-17 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and switchboard.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.58.0 <3.0.0
logging ^0.11.3+2 0.11.3+2
meta ^1.1.5 1.1.7
synchronized ^1.5.3 1.5.3+2 2.0.2+1
Dev dependencies
async ^2.0.8
test ^1.0.0