FlyRPC is a PROTOCOL implements maximum features with minimal packet size.
go get gopkg.in/flyrpc.v1
- Asynchronous Request/Response
- Request with unlimited string code and unlimited binary payload.
- Response with unlimited string code and unlimited binary payload.
- Compress code and payload
- Request can have an implicit
ack response
orno response
.
Name | Flag | Sequence | Code | Length | Payload |
---|---|---|---|---|---|
Bytes | 1 | 2 | string\0 | 1,2,4,8 | * |
1 | 2 | 3 | 4 | 5 | 6 | 7 - 8 |
---|---|---|---|---|---|---|
Response | Wait Response | Zip Code | Zip Payload | length bytes |
// level 1
conn.onRawPacket(flag, seq, rawCode, rawPayload)
conn.sendRawPacket(flag, seq, rawCode, rawPayload)
// level 2
conn.onPacket(flag, seq, code, payload)
conn.sendPacket(flag, seq, code, payload)
// level 3
conn.sendRequest(code, payload)
conn.sendResponse(seq, code, payload)
conn.onRequest(function handler(seq, code, payload))
conn.onResponse(function handler(seq, code, payload))
// level 4
conn.send(code, payload)
conn.request(code, payload, function callback(err, code, payload))
conn.handle(code, function handler(payload, function reply(code, payload)))
- [OK]TCP
- UDP
- Websocket
- P2P
- Compress
- [OK]json
- [OK]protobuf (proto3)
- [OK]msgpack
- Gateway Node
- Backend Node
MessageHandler could take below params
- *Context
- *Packet
- []byte
- *UserCustomMessage
MessageHandler could return below results
- UserCustomMessage, error
- UserCustomMessage
- error
- no return
TCP/UDP/WS Packet json/protobuf/msgpack
| + + + |
| | | | |
-->Protocol ------ | | Serializer <--
+ ------- | +
| | ----Route --------
| | | *+
| | | |
| | | Router
| | | + +
------- | | ---- |
1*| | + | |
--->Context |
|transport+* |
| ------ |
| | |
-->Client Server<-- MultiplexedServer<--
| | |
| | |
TCP/UDP/WS TCP/UDP/WS TCP/UDP/WS
- * Multiple instance
- --> Extends
- + Reference