Skip to content

Commit

Permalink
update notes style
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptouuuu committed Mar 10, 2024
1 parent 92dbff6 commit 07df006
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 11 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -8,7 +8,8 @@ Abstraction for most of the operating system the PHP code run on.

The goal is to deal with the operating system in a more abstract way (instead of dealing with concrete, low level, details).

**Important**: you must use [`vimeo/psalm`](https://packagist.org/packages/vimeo/psalm) to make sure you use this library correctly.
> [!IMPORTANT]
> you must use [`vimeo/psalm`](https://packagist.org/packages/vimeo/psalm) to make sure you use this library correctly.
## Installation

Expand Down
3 changes: 2 additions & 1 deletion documentation/advanced/logging.md
Expand Up @@ -2,7 +2,8 @@

If you want to trace everything that is done on your operating system you can use the logger decorator that will automatically write to your log file (almost) all operations.

**Note**: data and actions done on a socket are not logged as well as processes output to prevent logging too much data (at least for now).
> [!NOTE]
> data and actions done on a socket are not logged as well as processes output to prevent logging too much data (at least for now).
```php
use Innmind\OperatingSystem\OperatingSystem\Logger;
Expand Down
6 changes: 4 additions & 2 deletions documentation/readme.md
Expand Up @@ -8,7 +8,8 @@ The other advantage to use higher level abstractions is to enable end user to bu

For concrete examples have a look at the use cases available in the sidebar.

**Note**: this library is a small overlay on top of a set of individual libraries that contain the concrete abstractions. So you can start using only a subset of abstractions in your code as a starting point.
> [!NOTE]
> this library is a small overlay on top of a set of individual libraries that contain the concrete abstractions. So you can start using only a subset of abstractions in your code as a starting point.
## Installation

Expand All @@ -26,4 +27,5 @@ $os = Factory::build();

There's nothing more to add to start using this abstraction. Head toward the use cases to understand all the things you can do with it.

**Note**: This library doesn't work on windows environments.
> [!WARNING]
> This library doesn't work on windows environments.
3 changes: 2 additions & 1 deletion documentation/use_cases/filesystem.md
Expand Up @@ -131,4 +131,5 @@ Here it will run phpunit tests every time the `src/` folder changes. Concrete ex

This operation is a bit like an `array_reduce` as you can keep a state record between each calls of the callable via the first argument (here `0`, but it can be anything) and the argument of your callable will be the previous value returned by `$continuation->continue()`.

**Important**: since there is no builtin way to watch for changes in a directory it checks the directory every second, so use it with care. Watching an individual file is a bit safer as it uses the `tail` command so there is no `sleep()` used.
> [!WARNING]
> since there is no builtin way to watch for changes in a directory it checks the directory every second, so use it with care. Watching an individual file is a bit safer as it uses the `tail` command so there is no `sleep()` used.
6 changes: 4 additions & 2 deletions documentation/use_cases/http.md
Expand Up @@ -28,7 +28,8 @@ $response instanceof Response; // true

All elements of a request/response call is built using objects to enforce correctness of the formatted messages.

**Note**: since request and responses messages can be viewed either from a client or a server the model is abstracted in the standalone [`innmind/http` library](https://github.com/innmind/http).
> [!NOTE]
> since request and responses messages can be viewed either from a client or a server the model is abstracted in the standalone [`innmind/http` library](https://github.com/innmind/http).
## Resiliency in a distributed system

Expand Down Expand Up @@ -62,4 +63,5 @@ $response = $http($request);
$response = $http($request);
```

**Note**: the circuit breaker works on host per host basis meaning if `server1.com` fails then calls to `server2.com` will still be sent.
> [!NOTE]
> the circuit breaker works on host per host basis meaning if `server1.com` fails then calls to `server2.com` will still be sent.
6 changes: 4 additions & 2 deletions documentation/use_cases/ipc.md
Expand Up @@ -4,7 +4,8 @@ To communicate between processes on a same system there is 2 approaches: sharing

The later is the safest of the two (but not exempt of problems) and you will find here the building blocks to communicate via a socket.

**Note**: the adage `share state through messages and not messages through state` is a pillar of the [actor model](https://en.wikipedia.org/wiki/Actor_model) and [initially of object oriented programming](https://www.youtube.com/watch?v=7erJ1DV_Tlo).
> [!TIP]
> the adage `share state through messages and not messages through state` is a pillar of the [actor model](https://en.wikipedia.org/wiki/Actor_model) and [initially of object oriented programming](https://www.youtube.com/watch?v=7erJ1DV_Tlo).
```php
# process acting as a server
Expand Down Expand Up @@ -60,4 +61,5 @@ echo $client

In the case the server is started first then the client would print `Hello`.

**Important**: this is a very rough implementation of communication between processes. **DO NOT** use this simple implementation in your code, instead use a higher level API such as [`innmind/ipc`](https://github.com/innmind/ipc).
> [!WARNING]
> this is a very rough implementation of communication between processes. **DO NOT** use this simple implementation in your code, instead use a higher level API such as [`innmind/ipc`](https://github.com/innmind/ipc).
3 changes: 2 additions & 1 deletion documentation/use_cases/signals.md
Expand Up @@ -52,7 +52,8 @@ $client->unwrap()->close();

When the process receive the `SIGTERM` signal it will be paused then the anonymous function will be called and the process will then be resumed.

**Note**: signal handling is already performed when using [`innmind/ipc`](https://github.com/innmind/ipc) or [`innmind/amqp`](https://github.com/innmind/amqp) so you don't have to think about it.
> [!NOTE]
> signal handling is already performed when using [`innmind/ipc`](https://github.com/innmind/ipc) or [`innmind/amqp`](https://github.com/innmind/amqp) so you don't have to think about it.
## Prevent process from being stopped

Expand Down
3 changes: 2 additions & 1 deletion documentation/use_cases/time.md
Expand Up @@ -2,7 +2,8 @@

Directly accessing time in a PHP code is straightforward (either via `DateTime` or time functions) but it prevents you to build testable code or require to use some hard to understand hacks. Instead it is simpler to think of time as another dependency that you need to inject in your code, thus easier to change the implementation when testing.

**Note** for a more in length presentation of why directly accessing time is problematic you can watch this [talk](https://www.youtube.com/watch?v=T_I6HhP9-6w) (in french).
> [!TIP]
> for a more in length presentation of why directly accessing time is problematic you can watch this [talk](https://www.youtube.com/watch?v=T_I6HhP9-6w) (in french).
## Accessing time

Expand Down

0 comments on commit 07df006

Please sign in to comment.