Add infrastructure utilities: rate limiter and event bus #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds two production-ready infrastructure utilities to
nanda_core.utils:Rate Limiter
Event Bus
Integration Points
Rate Limiter Use Cases
Event Bus Use Cases
Changes
New Files
nanda_core/utils/rate_limiter.py- Token bucket rate limiter (203 lines)nanda_core/utils/event_bus.py- Async event bus (344 lines)nanda_core/utils/README.md- Comprehensive documentation with NEST-specific examplesModified Files
nanda_core/utils/__init__.py- Exports new utilitiessetup.py- Added httpx dependency, optional nats-py supportUsage Examples
Rate Limiter
Event Bus
Dependencies
httpx(required for webhook connector)nats-py(viapip install nest[events])Both httpx and nats-py are mature, well-maintained libraries used extensively in async Python applications.
Testing
Both utilities include working example code that can be run:
Documentation
Comprehensive README included with:
Compatibility
Contributor
Astrocity Foundation - Space Industry Standards Initiative
🤖 Generated with Claude Code