askrobots / dbbasic-object-primitive
Public
Python functions as REST objects, with clustering, load balancing and state replication; no containers or orchestration.
__init__.py · 1.0 KB · 35 lines
| 1 | """ |
| 2 | Protocol interfaces for the Object Primitive System. |
| 3 | |
| 4 | This module contains adapters for different protocols: |
| 5 | - REST: HTTP/REST interface (via dbbasic-web) |
| 6 | - gRPC: High-performance RPC interface |
| 7 | - WebSocket: Real-time bidirectional communication |
| 8 | - MQTT: Pub/sub messaging for IoT |
| 9 | - TCP: Raw TCP socket interface |
| 10 | - Events: Event-driven interface |
| 11 | - 9P: Plan 9 filesystem protocol |
| 12 | - Unix Sockets: Local IPC |
| 13 | |
| 14 | The endpoint code doesn't know or care which protocol is used. |
| 15 | Protocol adapters translate between protocols and the universal interface. |
| 16 | |
| 17 | Philosophy: |
| 18 | Protocols are just transport. They come and go (REST, gRPC, ???). |
| 19 | The endpoint stays stable. We add protocols without changing logic. |
| 20 | |
| 21 | Same endpoint, accessed via: |
| 22 | - curl http://server/endpoint (REST) |
| 23 | - mount server:/endpoints /mnt (9P) |
| 24 | - ws://server/endpoint (WebSocket) |
| 25 | - mqtt pub endpoint (MQTT) |
| 26 | """ |
| 27 | |
| 28 | __all__ = [ |
| 29 | # To be implemented in Phase 2+ |
| 30 | # "RESTInterface", |
| 31 | # "WebSocketInterface", |
| 32 | # "gRPCInterface", |
| 33 | # "MQTTInterface", |
| 34 | # "Plan9Interface", |
| 35 | ] |