How btvoidx/mint works
Core Components
• Mint Emitter (Core)
• Context-aware Emitter Extension
• Event Handlers/Consumers
• Event Flow
Main Architectural Elements
┌─────────────────────┐
• Mint Emitter │
• (Core Type) │
• ┘
┌─────────────────┐ ┌─────────────────┐
• Standard API │ │ Context API │
• (mint.go) │ │ (context/mint) │
• ┘ └─────────────────┘
Event Flow Representation
Event flow pattern with these components:
[Event Producer] → [Emitter] → [Event Consumers]
Design Guidelines:
Specific Interactions
• Event emission flow
• Subscription/unsubscription mechanism
• Context propagation (for context-aware operations)
The Emitter Core
• ┌─────────────────────────────┐
• Mint Emitter │
• ┌─────────────────────────┐ │
• Event Registry │ │
• ┘ │
• ┘
API Layers
• ┌─────────────┐ ┌─────────────┐
• Standard API│ │ Context API │
• Emit() │ │ - Emit() │
• On() │ │ + Context │
• ┘ └─────────────┘
Event Flow
• [Producer] → [Emitter] → [Consumer 1]
• → [Consumer 2]
• → [Consumer N]
Important Details to Note:
Generic type flow (T any)
• → Synchronous event flow
• ⇢ Asynchronous event flow
• ⊗ Unsubscription point
• ⋈ Context cancellation point