Skip to content

an-dr/hyphoria

Repository files navigation

Hyphoria Messaging Framework

Work in progress!

I've decided to make my intermediate work public because it stimulates be to work with higher quality.

Overview

Multi-bus, type-safe event library. Supports zero-copy local delivery and serialized remote transport (MQTT, network, etc).

  • Cell = node
  • Nucleus = hub
  • Membrane = gateway
  • Signal = message
  • Hypha = transport (the link/pathway)

Architecture

┌──────────────┐
│    User      │
└──────┬───────┘
       │
       ▼
┌─────────────────────┐
│  Publisher/         │  Multi-topic
│  Subscriber         │  Multi-bus
│  Endpoint           │
└──────┬──────────────┘
       │
       ▼
┌─────────────────────┐
│   HyphaBus(es)      │  Routing
└──┬────────┬─────────┘  Serialization
   │        │
   ▼        ▼
┌────────┐ ┌──────────┐
│ Local  │ │ Backend  │  Transport
│Callback│ │ (MQTT..) │  (raw bytes)
└────────┘ └──────────┘

Components

1. Endpoint (User Interface)

Responsibility: User-facing API for publishing/subscribing

Characteristics:

  • Can connect to multiple buses simultaneously
  • Handles multiple topics
  • Type-safe publish/subscribe
  • No serialization logic

Separation: PublisherEndpoint vs SubscriberEndpoint (single responsibility)

2. Hypha (EventBus, Router)

Responsibility: Route events between endpoints and backends

Key functions:

  • Dispatch events to local subscribers (zero-copy via shared_ptr)
  • Serialize events for remote backends
  • Maintain subscriber registry
  • Manage backend connections

Serialization strategy: Happens HERE, once per event, for all remote backends

3. Backend (Transport)

Responsibility: Transport serialized bytes to external systems

Interface: Receives (EventMetadata, byte_payload), handles delivery

Examples: MQTT, TCP, IPC, file logging

4. Event Data Model

Event = Data + Metadata

  • Data: shared_ptr<T> (user-allocated, immutable after publish)
  • Metadata: Topic, type info, timestamp (value type, bus-allocated)

About

A messaging framework to abstract of eventing backends and create complex multi-transport messaging networks

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages