From 24637cd3776cda5fd0a919ba9343ba86d82d3e04 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 18 Mar 2026 01:57:01 +0000 Subject: More fixes, ftrigr_string addition, doc update --- doc/libs6/ftrigr.html | 132 +++++++++++++++++++++------------------------- doc/libs6/s6-ftrigrd.html | 37 ++++++------- 2 files changed, 76 insertions(+), 93 deletions(-) (limited to 'doc/libs6') diff --git a/doc/libs6/ftrigr.html b/doc/libs6/ftrigr.html index 052d7bf..a8cf98b 100644 --- a/doc/libs6/ftrigr.html +++ b/doc/libs6/ftrigr.html @@ -43,11 +43,6 @@ and to always use wait_nohang() to reap children, simply ignoring pids you don't know.

-

- If your application has trouble handling unknown -children, consider using an ftrigrd service. (And fix your application!) -

-

A programming example

@@ -61,8 +56,8 @@ for instance, illustrate how to use the ftrigr library.

-int ftrigr_checksa (ftrigr_t *a, uint16_t id, stralloc *what)
+void ftrigr_ack (ftrigr *a, uint32_t id)
 

- Checks whether an event happened to id. Use after a -call to ftrigr_update(), as an alternative to ftrigr_check(). + Resets the stored string of events. The next invocation of +ftrigr_peek() will only show new events, if any.

- -
-void ftrigr_ack (ftrigr_t *a, size_t n)
+int ftrigr_release (ftrigr *a, uint32_t id)
 

- Acknowledges reading n ids from the id list updated by -ftrigr_updateb. + Frees the resources used by subscription id. Use this +after getting an event from a subscription done without the +FTRIGR_REPEAT flag and reading its results, if you want to +keep the session open and perform more subscriptions.

-
-int ftrigr_update (ftrigr_t *a)
-
-

- Acknowledges all the pending ids (i.e. clears the stored id list) -then calls ftrigr_updateb(). + If subscription id was given the FTRIGR_REPEAT flag, +use ftrigr_unsubscribe() instead. If you're not going +to perform other subscriptions, ftrigr_end() will +free all the resources without you needing to call +ftrigr_release() first.

diff --git a/doc/libs6/s6-ftrigrd.html b/doc/libs6/s6-ftrigrd.html index 7325c72..672b660 100644 --- a/doc/libs6/s6-ftrigrd.html +++ b/doc/libs6/s6-ftrigrd.html @@ -17,7 +17,7 @@ skarnet.org

-

The s6-ftrigrd program

+

The s6-ftrigrd internal program

s6-ftrigrd is a helper program that manages a set of subscriptions to fifodirs as well @@ -29,24 +29,17 @@ events happen.

Interface

- s6-ftrigrd is not meant to be called directly. -

- - +notifications. +

+ +

When the client uses ftrigr_end(), or closes s6-ftrigrd's stdin in +any way, s6-ftrigrd exits 0. +

s6-ftrigrd handles the grunt work of creating fifos in a @@ -60,7 +53,7 @@ the client.

The connection management between the client and s6-ftrigrd is entirely done -by the textclient library from skalibs. +by the sassclient library from skalibs.

@@ -71,9 +64,13 @@ to read them. To avoid uncontrolled growth, make sure your client calls

- An s6-ftrigrd instance can only handle up to FTRIGRD_MAX (defined in s6/ftrigr.h) -subscriptions at once. By default, this number is 1000, which is more than enough for -any reasonable system. + The number of concurrent subscriptions that an s6-ftrigrd instance can handle is +only limited by RAM and open file descriptors. It is likely that the latter is the +bottleneck: s6-ftrigrd uses two file descriptors per fifodir. With a default +limit of 1024 open file descriptors per process, it means that s6-ftrigrd can +handle around 500 concurrent fifodirs, which is reasonable for most systems, but +make sure to increase the open files resource limit before starting an ftrigr +session if you need more.

-- cgit v1.3.1