1.5.2 • Published 7 years ago

sendy-ws v1.5.2

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

Messenger pipeline

The clients in these modules are broken up into two types, reliable and unreliable

Unreliable clients can fail to deliver messages, get disconnected, etc. When you say unreliable.send(msg), you will never know if it was delivered. These clients talk directly over an unreliable network: websockets, udp, etc.

Reliable clients have no concept of a network, but guarantee in-order delivery if plugged into an unreliable client. At the core of the reliable client pipeline is a delivery-mechanism-agnostic implementation of the UTP protocol.

In certain situations, you need to wrap each packet that travels across the network in a special envelope, in which case you have the design below.

Because the UTP protocol will break things up into messages,

The basic design:

top level (application layer)

var reliable = {} // one per sender/recipient pair

// these can vary var unreliable = new Client({ url: '/some/websocket/url' }) (knows nothing of recipients)

// these guys don't know about unreliable // just a msg pipeline reliableto.send(msg) // e.g. @tradle/otr-client -> sendy.send(msg) // length-prefix (@tradle/sendy) ('send', piece) // utp (break up into pieces) <- // bubble <- // bubble ('send', msg, to)

// we know who it's for because all those intermediates // are per-recipient

msg = wrap(msg) // wrap in to/from envelope u.send(msg)

u.on 'message' msg = unpack(msg) // unwrap envelope -> clientsmsg.from.receive(msg.data) // bubble -> sendy.receive(msg) // bubble ('receive', msg) // piece-together, emit <- // length-prefix <- // otr client msg

1.5.2

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.1

7 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago