Skip to content

Commit 791c9a4

Browse files
lazer-devAlex Danilenko
andauthored
reactor improvements (#48)
Co-authored-by: Alex Danilenko <[email protected]>
1 parent e7963c2 commit 791c9a4

File tree

6 files changed

+235
-80
lines changed

6 files changed

+235
-80
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ spotty.before("/api/user/file/*", POST, "application/pdf", (request, response) -
337337
});
338338
```
339339

340-
`After filters` evaluate after each request even if in `before filter` or route there was an exception.
340+
`After filters` execute your code after each request, even if there was an exception in `before filter`, or in the `route` handling this request.
341341
Same as for `before filter`, you can optionally pass a route template path, http method and content-type to restrict the filter for the matched path, http method and content-type.
342342
```java
343343
// attach the Instant object to the request to save the start timestamp of the beginning of the request
@@ -432,8 +432,17 @@ final Spotty spotty = Spotty.builder()
432432
// to customise this you can use this builder function
433433
.sessionCheckTickDelay(int sessionCheckTickDelay, TimeUnit timeUnit)
434434

435-
.defaultSessionTtl(long defaultSessionTtl) // set default session time-to-live (1 day by default)
436-
.defaultSessionCookieTtl(long defaultSessionCookieTtl) // set default SSID cookie time-to-live (Spotty session id cookie)
437-
.reactorWorkers(int reactorWorkers) // number of threads that handles the queue of requests (24 by default)
435+
.defaultSessionTtl(long defaultSessionTtl) // set default session time-to-live in seconds (1 day by default)
436+
.defaultSessionCookieTtl(long defaultSessionCookieTtl) // set default SSID cookie time-to-live in seconds (Spotty session id cookie)
437+
438+
.reactorMinWorkers(int reactorMinWorkers) // minimum number of threads that can handle the queue of requests, even if they are idle (24 by default)
439+
.reactorMaxWorkers(int reactorMaxWorkers) // maximum number of threads that can handle the queue of requests (200 by default)
440+
441+
// when the number of threads > reactorMinWorkers,
442+
// this parameter controls the maximum time that excess idle workers
443+
// workers will wait for new tasks before terminating (300 by default)
444+
.reactorKeepAliveTime(long reactorKeepAliveTime)
445+
446+
.reactorTimeUnit(TimeUnit reactorTimeUnit) // the time unit for the reactorKeepAliveTime argument (SECONDS by default)
438447
.build();
439448
```

0 commit comments

Comments
 (0)