Skip to content

Commit

Permalink
changes for new_Arch
Browse files Browse the repository at this point in the history
  • Loading branch information
aadhavanpl committed Apr 25, 2024
1 parent ddf286f commit e31cdf0
Show file tree
Hide file tree
Showing 22 changed files with 258 additions and 246 deletions.
68 changes: 38 additions & 30 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,23 @@ export default defineConfig({
link: '/roadmap/phase-0/stage-0.md',
},
{
text: 'Stage 1: TCP server',
text: 'Stage 1: TCP Server',
link: '/roadmap/phase-0/stage-1',
},
{
text: 'Stage 2: TCP client',
text: 'Stage 2: TCP Client',
link: '/roadmap/phase-0/stage-2',
},
{
text: 'Stage 3: Epoll',
text: 'Stage 3: Linux epoll',
link: '/roadmap/phase-0/stage-3',
},
{
text: 'Stage 4: UDP server with multi-threading',
text: 'Stage 4: UDP Multi-threading',
link: '/roadmap/phase-0/stage-4',
},
{
text: 'Stage 5: TCP proxy',
text: 'Stage 5: TCP Proxy',
link: '/roadmap/phase-0/stage-5',
},
],
Expand All @@ -110,25 +110,29 @@ export default defineConfig({
link: '/roadmap/phase-1/',
},
{
text: 'Stage 6: Server & Client module',
text: 'Stage 6: Listener & Connection Modules',
link: '/roadmap/phase-1/stage-6',
},
{
text: 'Stage 7: Core & Loop module',
text: 'Stage 7: Core & Loop Modules',
link: '/roadmap/phase-1/stage-7',
},
{
text: 'Stage 8: TCP module',
text: 'Stage 8: Pipe Module',
link: '/roadmap/phase-1/stage-8',
},
{
text: 'Stage 9: Upstream module',
text: 'Stage 9: Upstream Module',
link: '/roadmap/phase-1/stage-9',
},
{
text: 'Stage 10: File module',
link: '/roadmap/phase-1/stage-10',
},
{
text: 'Stage 11: Session Module',
link: '/roadmap/phase-1/stage-11',
},
],
},
{
Expand All @@ -140,21 +144,21 @@ export default defineConfig({
link: '/roadmap/phase-2/',
},
{
text: 'Stage 11: HTTP parser',
link: '/roadmap/phase-2/stage-11',
},
{
text: 'Stage 12: HTTP req & HTTP res',
text: 'Stage 12: HTTP Request Module',
link: '/roadmap/phase-2/stage-12',
},
{
text: 'Stage 13: Config & Session module',
text: 'Stage 13: HTTP Response Module',
link: '/roadmap/phase-2/stage-13',
},
{
text: 'Stage 14: HTTP Spec',
text: 'Stage 14: Config Module',
link: '/roadmap/phase-2/stage-14',
},
{
text: 'Stage 15: HTTP Specification',
link: '/roadmap/phase-2/stage-15',
},
],
},
{
Expand All @@ -166,25 +170,25 @@ export default defineConfig({
link: '/roadmap/phase-3/',
},
{
text: 'Stage 15: IP whitelist & blacklist',
link: '/roadmap/phase-3/stage-15',
},
{
text: 'Stage 16: Directory browsing',
text: 'Stage 16: Directory Browsing',
link: '/roadmap/phase-3/stage-16',
},
{
text: 'Stage 17: Compression',
text: 'Stage 17: IP Whitelist/Blacklist',
link: '/roadmap/phase-3/stage-17',
},
{
text: 'Stage 18: Load balancing',
text: 'Stage 18: Gzip Compression',
link: '/roadmap/phase-3/stage-18',
},
{
text: 'Stage 19: Rate limiting & timeouts',
text: 'Stage 19: Load Balancing',
link: '/roadmap/phase-3/stage-19',
},
{
text: 'Stage 20: Request timeouts',
link: '/roadmap/phase-3/stage-20',
},
],
},
{
Expand All @@ -196,17 +200,21 @@ export default defineConfig({
link: '/roadmap/phase-4/',
},
{
text: 'Stage 20: TLS',
link: '/roadmap/phase-4/stage-20',
},
{
text: 'Stage 21: Caching',
text: 'Stage 21: Metrics',
link: '/roadmap/phase-4/stage-21',
},
{
text: 'Stage 22: Multiprocess Architecture',
text: 'Stage 22: Multiprocess',
link: '/roadmap/phase-4/stage-22',
},
{
text: 'Stage 23: Caching',
link: '/roadmap/phase-4/stage-23',
},
{
text: 'Stage 24: Transport Layer Security (TLS)',
link: '/roadmap/phase-4/stage-24',
},
],
},
],
Expand Down
8 changes: 4 additions & 4 deletions docs/guides/resources/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ A detailed view of the _structs_ and _functions_ present in each module will be

### `xps_core`

The `xps_core` module serves as the container to which [instances](<https://en.wikipedia.org/wiki/Instance_(computer_science)>) of all other modules are attached. It can be thought of as an instance of eXpServer.
The `xps_core` module serves as the container to which [instances](<https://en.wikipedia.org/wiki/Instance_(computer_science)>) of all other modules are attached. It can be thought of as an instance of eXpServer itself.

### `xps_loop`

The `xps_loop` module contains the [event loop](https://en.wikipedia.org/wiki/Event_loop). Event loop is the engine that drives eXpServer. It is implemented using Linux [epoll](https://en.wikipedia.org/wiki/Epoll). TCP sockets are attached to epoll to monitor for events. On receiving event notifications, the loop will handle them through [callback functions](<https://en.wikipedia.org/wiki/Callback_(computer_programming)>). Another responsibility of the loop is to drive the `xps_pipe`, through which the bytes flow from one module to another (`xps_pipe` will be explained subsequently).

### `xps_config`

The `xps_config` module is responsible for reading and parsing the configuration file, the path to which is provided as a [command line argument](https://en.wikipedia.org/wiki/Command-line_interface#Arguments). The configuration file is written and parsed using [Lua](<https://en.wikipedia.org/wiki/Lua_(programming_language)>) into a configuration _struct_ and stored in the `xps_core` instance.
The `xps_config` module is responsible for reading and parsing the configuration file, the path to which is provided as a [command line argument](https://en.wikipedia.org/wiki/Command-line_interface#Arguments). The configuration file will be a JSON file with a specific structure. It is parsed using [parson](https://github.com/kgabis/parson), a 3rd party JSON parser. After parsing, it is stored in the `xps_core` instance as a configuration _struct_.

### `xps_listener`

Expand Down Expand Up @@ -93,7 +93,7 @@ Read more about _pipes_ below.

## xps_pipes

Pipes in eXpServer are the links that allow uni-directional [controlled flow](<https://en.wikipedia.org/wiki/Flow_control_(data)>) of bytes from one node to another. An xps_pipe is an instance of `xps_pipe_t` type and is attached to a source instance of type `xps_pipe_source_t` on one end and a sink instance of type `xps_pipe_sink_t` on the other.
Pipes in eXpServer are the links that allow uni-directional [controlled flow](<https://en.wikipedia.org/wiki/Flow_control_(data)>) of bytes from one node to another. An `xps_pipe` is an instance of `xps_pipe_t` type and is attached to a source instance of type `xps_pipe_source_t` on one end and a sink instance of type `xps_pipe_sink_t` on the other.

Let us take a look at an example

Expand Down Expand Up @@ -124,7 +124,7 @@ Now let us look at how this works
In our case,

- If the source is writing to the pipe faster than the sink is reading it, then the pipe buffer will fill up and reach above the buffer threshold. If that happens, even if the source is ready, `handler_cb()` on the source will not be invoked, there by ‘blocking’ the source from writing to the pipe.
- Similarly, if the sink is reading from the pipe faster than the source is writing to it, then, when the pipe becomes empty the `handler_cb()` on the sink will not be invoked even if the sink is ready, there by ‘blocking’ the sink from reading from the pipe
- Similarly, if the sink is reading from the pipe faster than the source is writing to it, then, when the pipe becomes empty, the `handler_cb()` on the sink will not be invoked even if the sink is ready, thereby ‘blocking’ the sink from reading from the pipe

### Isolation of Logic

Expand Down
28 changes: 15 additions & 13 deletions docs/roadmap/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,34 @@ The eXpServer project comprises 22 stages, organized into 5 phases. Prior to the
### Phase 1: Building the core of eXpServer by creating reusable modules

- [Overview](phase-1/)
- [Stage 6: Server & Client Modules](phase-1/stage-6)
- [Stage 6: Listener & Connection Modules](phase-1/stage-6)
- [Stage 7: Core & Loop Modules](phase-1/stage-7)
- [Stage 8: TCP Module](phase-1/stage-8)
- [Stage 8: Pipe Module](phase-1/stage-8)
- [Stage 9: Upstream Module](phase-1/stage-9)
- [Stage 10: File Module](phase-1/stage-10)
- [Stage 11: Session Module](phase-1/stage-11)

### Phase 2: Implementing HTTP support

- [Overview](phase-2/)
- [Stage 11: HTTP Parser](phase-2/stage-11)
- [Stage 12: HTTP Req & Res Modules](phase-2/stage-12)
- [Stage 13: Config & Session Modules](phase-2/stage-13)
- [Stage 14: HTTP Specification](phase-2/stage-14)
- [Stage 12: HTTP Request Module](phase-2/stage-12)
- [Stage 13: HTTP Response Module](phase-2/stage-13)
- [Stage 14: Config Module](phase-2/stage-14)
- [Stage 15: HTTP Specification](phase-2/stage-15)

### Phase 3: Adding features to eXpServer

- [Overview](phase-3/)
- [Stage 15: IP Whitelist/Blacklist](phase-3/stage-15)
- [Stage 16: Directory Browsing](phase-3/stage-16)
- [Stage 17: Gzip Compression](phase-3/stage-17)
- [Stage 18: Load Balancing](phase-3/stage-18)
- [Stage 19: Rate Limiting & Timeout](phase-3/stage-19)
- [Stage 17: IP Whitelist/Blacklist](phase-3/stage-17)
- [Stage 18: Gzip Compression](phase-3/stage-18)
- [Stage 19: Load Balancing](phase-3/stage-19)
- [Stage 20: Request timeouts](phase-3/stage-20)

### Phase 4: Advanced features and multiprocess architecture

- [Overview](phase-4/)
- [Stage 20: Transport Layer Security (TLS)](phase-4/stage-20)
- [Stage 21: Caching](phase-4/stage-21)
- [Stage 22: Multiprocess Architecture](phase-4/stage-22)
- [Stage 21: Metrics](phase-4/stage-22)
- [Stage 22: Multiprocess](phase-4/stage-22)
- [Stage 23: Caching](phase-4/stage-23)
- [Stage 24: Transport Layer Security (TLS)](phase-4/stage-24)
1 change: 1 addition & 0 deletions docs/roadmap/phase-1/stage-11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Stage 11: Session Module
2 changes: 1 addition & 1 deletion docs/roadmap/phase-1/stage-6.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Stage 6: Server & Client Modules
# tage 6: Listener & Connection Modules

## Recap

Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap/phase-1/stage-8.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Stage 8: TCP Module
# Stage 8: Pipe Module
Loading

0 comments on commit e31cdf0

Please sign in to comment.