SocketCluster / SocketCluster/socketcluster

Simple typescript Example

Open
#449 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
6.2k
Forks
318
PR merge metrics
No merged PRs in 30d

Description

Sorry to be a pain... Ive been trying to do this on my own and am failing...

First off, I'd like to use typescript. Its somewhat working.

Second, and correct me if I'm not using the library correctly, let me explain what I THINK that I would like it to do..

I would like to have a couple different services run, that all use this exchange to pass messages back and forth. It looks like I need to create new classes for each of the different "services" that I am trying to recreate..

Lets say for example, I want to have a service that does CRUD on a users profile, 1 that does CRUD on an "Orders" table, and 1 that listens for events emitted to it, from another service, to then update some data in a database and also emit it out to some clients.

In express, I would do the majority of this work inside a controller per service, and then assign "routes" to them, to split up the code.

Sorry again for long winded question. Here is my understanding from another post:

The cluster has 1 worker, which can scale. Great. You mentioned that we can require (and I would assume import), code to break up the complexity of any 1 file.

I would then think that, in each sub-worker, if you will, I could subscribe to events emitted within the system, and then it would do some unit of work (save to database and then emit something else out)

What class should I extend to get access to the events in each of my sub-workers?

Thanks for the help.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no file, test, or entry point. Start by locating the repository's TypeScript example and worker/event API, then determine whether a documented service example is an agreed project need; done would require a clear example that answers the described service and event questions.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
backend, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.