Crate tap_node

Source
Expand description

TAP Node - A node implementation for the TAP protocol

The TAP Node is the central component that manages TAP Agents, routes messages, processes events, and provides a scalable architecture for TAP deployments.

§Key Components

  • Agent Registry: Manages multiple TAP Agents
  • Event Bus: Publishes and distributes events throughout the system
  • Message Processors: Process incoming and outgoing messages
  • Message Router: Routes messages to the appropriate agent
  • Processor Pool: Provides scalable concurrent message processing

§Thread Safety and Concurrency

The TAP Node is designed with concurrent operations in mind. It uses a combination of async/await patterns and synchronization primitives to safely handle multiple operations simultaneously. Most components within the node are either immutable or use interior mutability with appropriate synchronization.

§Message Flow

Messages in TAP Node follow a structured flow:

  1. Receipt: Messages are received through the receive_message method
  2. Processing: Each message is processed by the registered processors
  3. Routing: The router determines which agent should handle the message
  4. Dispatch: The message is delivered to the appropriate agent
  5. Response: Responses are handled similarly in the reverse direction

§Scalability

The node supports scalable message processing through the optional processor pool, which uses a configurable number of worker threads to process messages concurrently. This allows a single node to handle high message throughput while maintaining shared between threads, with all mutable state protected by appropriate synchronization primitives.

Re-exports§

pub use error::Error;
pub use error::Result;
pub use event::logger::EventLogger;
pub use event::logger::EventLoggerConfig;
pub use event::logger::LogDestination;
pub use event::EventSubscriber;
pub use event::NodeEvent;
pub use message::sender::HttpPlainMessageSender;
pub use message::sender::NodePlainMessageSender;
pub use message::sender::PlainMessageSender;
pub use message::sender::WebSocketPlainMessageSender;

Modules§

agent
Agent management for TAP Node
error
Error handling for TAP Node
event
Event System for TAP Node
message
PlainMessage processing and routing for TAP Node
resolver
DID resolution for TAP Node

Structs§

NodeConfig
Configuration for a TAP Node
TapNode
The TAP Node

Traits§

TapAgentExt
This trait extends the TapAgent with methods for serializing and packing DIDComm messages for transmission. It provides functionality for converting in-memory message objects to secure, serialized formats that follow the DIDComm messaging protocol standards.