You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/advanced/logging.md
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,12 @@
2
2
3
3
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.
4
4
5
-
!!! note ""
6
-
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).
7
-
8
5
```php
9
-
use Innmind\OperatingSystem\OperatingSystem\Logger;
6
+
use Innmind\OperatingSystem\Config\Logger;
10
7
use Psr\Log\LoggerInterface;
11
8
12
-
$os = Logger::psr(
13
-
$os,
14
-
/* any instance of LoggerInterface */
9
+
$os = $os->map(
10
+
Logger::psr(/* any instance of LoggerInterface */),
Copy file name to clipboardExpand all lines: documentation/use_cases/http.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,10 +36,10 @@ All elements of a request/response call is built using objects to enforce correc
36
36
One of the first things taught when working with distributed systems is that they will intermittently fail. To prevent your app to crash for an occasional failure a common pattern is the _retry pattern_ with a backoff strategy allowing the client to retry safe requests a certain amount of time before giving up. You can use this pattern like so:
37
37
38
38
```php
39
-
use Innmind\OperatingSystem\OperatingSystem\Resilient;
39
+
use Innmind\OperatingSystem\Config\Resilient;
40
40
use Innmind\HttpTransport\ExponentialBackoff;
41
41
42
-
$os = Resilient::of($os);
42
+
$os = $os->map(Resilient::new());
43
43
$http = $os->remote()->http();
44
44
$http instanceof ExponentialBackoff; // true
45
45
```
@@ -48,12 +48,12 @@ Another strategy you can add on top of that is the [circuit breaker pattern](htt
Copy file name to clipboardExpand all lines: documentation/use_cases/ipc.md
+49-46Lines changed: 49 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,57 +7,60 @@ The later is the safest of the two (but not exempt of problems) and you will fin
7
7
!!! tip ""
8
8
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).
static fn() => null, // background processes don't have a pid
31
+
);
21
32
```
22
33
23
34
Here we start the PHP builtin webserver and perform some imaginary action before killing it, but you could also wait the process to finish (see below) instead of killing it (in the case of the webserver it never finishes unless with a crash).
0 commit comments