# Introduction

**TxJS** implement an execution model based on [RxJS](https://rxjs-dev.firebaseapp.com/) and [TypeSript](https://www.typescriptlang.org/). In many cases application needs to preform a flow (some job) which is a collection of small "steps" (a component). This get complicated when some of the steps are asynchronous specially in nodejs environment.

So this module aim to provide a set of classes helping to modeling a design solving such problems.

* **Component** - is one of the building block of a job. it is just a regular class (usually a singleton) which does any work. BUT a component has NO API to activate its work, you can say that components is kind of `floating in the air`. The only way to communicate with a component is by *send it a message*. What unique about a component is that its include a "mountpoint". Using this *mountpoint* the component able to communicate with the world.
* **MountPoint** - is a class which has two way communication channels with the world. A component use a mountpoint to get messages on "*tasks*" channel and reply back "*reply*" channel. Mountpoint is using two RxJs Subjects to get and send back messages.
* **QueuePoint -** a kind of mount use to communicate with other component in process or between processed using some kind of message queue (RabbitMQ, Kafka ..). This object is part *of Component-2-Component* direct communication (C2C).
* **RoutePoint -** same as QueuePoint but using node express for C2C.
* **Job** - is a class store collection of components which are running one after another to for fill a complete flow. Output of previous component is the input to the next one. A job use the component's mountpoint to send its task then while getting reply it send it to next one.

  > One of strong feature of a Job to serialize / deserialize. In the middle of a Job execution you serialize it to a JSON, store it then later on rebuild it and continue it execution in the exect point where it stop.
* **MountPoint Repository** - A class generate and store mountpoints by their names or Symbols. So by getting the mountpoint from the registry you can use it to communicate with a component.
* **Task** - a wrapper object you data travel between the components during execution. It include a head property and data property. The head is a generic type where the data is any type.
* **Job Registry** - a class store Job by their uuid. Also you can set the job registry with a "persistence driver" use by a job to persist them self (according to execution options). Currently the driver is global for al jobs, in the later releases it will include more detail scoping so you will be able to different persistence driver to different jobs.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rxjs.gitbook.io/rx-txjs/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
