removed doodoo projects, getting ready for restructuring
This commit is contained in:
parent
674112af05
commit
5c64b1ccf8
82 changed files with 5 additions and 8917 deletions
|
|
@ -1,42 +0,0 @@
|
|||
# Event Bus Library
|
||||
|
||||
A Redis-based event bus implementation for inter-service communication in the stock-bot project.
|
||||
|
||||
## Features
|
||||
|
||||
- Publish/subscribe pattern for asynchronous messaging
|
||||
- Support for typed events based on `@stock-bot/types`
|
||||
- Reliable message delivery
|
||||
- Channel-based subscriptions
|
||||
|
||||
## Usage
|
||||
|
||||
```typescript
|
||||
import { createEventBus } from '@stock-bot/event-bus';
|
||||
import { MarketDataEvent } from '@stock-bot/types';
|
||||
|
||||
// Create an event bus instance
|
||||
const eventBus = createEventBus({
|
||||
redisHost: 'localhost',
|
||||
redisPort: 6379
|
||||
});
|
||||
|
||||
// Subscribe to market data events
|
||||
eventBus.subscribe('market.data', async (event: MarketDataEvent) => {
|
||||
console.log(`Received price update for ${event.data.symbol}: ${event.data.price}`);
|
||||
});
|
||||
|
||||
// Publish an event
|
||||
await eventBus.publish('market.data', {
|
||||
type: 'MARKET_DATA',
|
||||
data: {
|
||||
symbol: 'AAPL',
|
||||
price: 150.25,
|
||||
bid: 150.20,
|
||||
ask: 150.30,
|
||||
volume: 1000000,
|
||||
timestamp: new Date()
|
||||
},
|
||||
timestamp: new Date()
|
||||
});
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue