@jetit/publisher 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -3
  2. package/src/README.md +0 -43
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetit/publisher",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "type": "commonjs",
5
5
  "dependencies": {
6
6
  "@jetit/id": "0.0.6",
@@ -12,6 +12,5 @@
12
12
  "tslib": "2.5.0"
13
13
  },
14
14
  "main": "./src/index.js",
15
- "types": "./src/index.d.ts",
16
- "readme": "README.md"
15
+ "types": "./src/index.d.ts"
17
16
  }
package/src/README.md DELETED
@@ -1,43 +0,0 @@
1
- # publisher
2
-
3
- publisher is a library for implementing an event-driven architecture using Redis PUB/SUB and Redis Streams. It provides a simple and scalable mechanism for publishing and consuming events in real-time, and supports features such as message deduplication, consumer group management, and scheduled event publishing.
4
-
5
- ## Simple Example
6
-
7
- ```typescript
8
- import { Publisher, EventData } from '@jetit/streams';
9
-
10
- // Create an instance of the publisher
11
- const streams = new Streams('Websockets');
12
-
13
- // Publish an event
14
- const eventData: EventData<{ message: string }> = {
15
- eventName: 'my-event',
16
- data: { message: 'Hello, world!' }
17
- };
18
-
19
- await streams.publish(eventData);
20
-
21
- // Subscribe to an event
22
- streams.listen('my-event').subscribe(event => {
23
- console.log(`Received event: ${event.eventName}`, event.data);
24
- });
25
- ```
26
-
27
- ## Possible use cases
28
-
29
- 1. Microservices communication: If your system is composed of multiple microservices, the publisher can be used to facilitate communication between them by publishing and listening to events.
30
-
31
- 2. Event sourcing and CQRS: In an event-sourced system, the publisher can be used to store and process events that represent the state changes of the system, enabling Command Query Responsibility Segregation (CQRS) by separating the read and write models.
32
-
33
- 3. Task queues: The publisher can be used to create task queues for distributing workloads among different worker instances, ensuring that tasks are processed in the order they were created.
34
-
35
- 4. Data streaming and processing: The publisher can be used to ingest and process large volumes of data in real-time, such as log files, clickstream data, or other event-based data.
36
-
37
- 5. Distributed system coordination: In a distributed system, the publisher can be used for coordination between different components, such as managing leader election or maintaining configuration information.
38
-
39
- 6. Real-time analytics and monitoring: The publisher can be used to collect and process real-time analytics data, such as user behavior, application performance metrics, or system monitoring information.
40
-
41
- 7. Event-driven workflows: You can use the publisher to create event-driven workflows, where each step in the workflow is triggered by the completion of a previous step. This can be useful for orchestrating complex, multi-step processes.
42
-
43
- 8. Message broadcasting: The publisher can be used to broadcast messages to multiple consumers or subscribers, allowing for efficient and scalable communication in applications with many components or services.