Skip to content

atiampa/pubsub-Design-pattern

Repository files navigation

Pub-Sub Design Pattern

This repository demonstrates my implementation of the Pub-Sub design pattern as part of the assignment for Taobin.

Key Features

The implementation consists of the following components:

  1. machine.ts: Defines the machine entity and its stock management.
  2. event.ts: Represents events that can be published and subscribed to.
  3. subscribe.ts: Handles subscriber behavior for different event types.
  4. PublishSubscribeService.ts: Implements the pub-sub mechanism to manage event publication and subscription.
  5. main.ts: Contains the main logic to demonstrate and test the system's functionality.

Additionally, the idea.ts and app.ts files are prototypes and not part of the main execution process.

Setup Instructions

Prerequisites

Build and Run Using Makefile

  1. Open a terminal in the repository's root directory.
  2. Use the following commands:
    • Build: Compile TypeScript files to JavaScript.
      make build
    • Run: Execute the program.
      make run
    • Clean: Remove compiled JavaScript files.
      make clean
    • Help: Display available commands.
      make help

Manual Build and Run

  1. Compile the TypeScript code:
    tsc main.ts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors