switchboard 2.0.9

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • new70

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.9

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

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, other

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

Health issues and suggestions

Document public APIs (-9.01 points)

64 out of 71 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Fix lib/src/mux_connection.dart. (-1 points)

Analysis of lib/src/mux_connection.dart reported 2 hints:

line 32 col 8: Unused import: 'dart:convert'.

line 38 col 8: Unused import: 'package:switchboard/src/mux_channel_impl.dart'.

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

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

line 8 col 8: Unused import: 'dart:convert'.

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

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

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

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use switchboard.dart.

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.6
synchronized ^1.5.3 1.5.3
Dev dependencies
async ^2.0.8
test ^1.0.0