ntfy/server
Nick Farrell 09e8fb81b5
Accumulate incoming messages in a buffered channel
Instead of using a deque, store incoming messages in a native
buffered channel, if buffering is enabled.

In addition, modify the batching algorithm so the enforced delay
between consecutive `addMessages` invocations is applied after
all pending messages are processed. This acts as a "cooldown", rather
than a "warmup". This avoids the need for more complex timing logic to
dispatch batches, removes latency in adding messages when received
infrequently, and natively blocking the goroutine until messages are
received.

Because the message processing loop always performs a blocking read
first, it is appropriate for low-throughput environments just as much as
high-throughput ones.

The default value of batchSize has been changed to 10, with a zero
cooldown. This means that when messages are arriving faster than they
can be inserted into sqlite, they will automatically become batched in
groups of up to 10.
2022-12-23 08:30:47 +11:00
..
actions.go Bump Go version, Generics whoooo 2022-10-01 15:50:48 -04:00
actions_test.go Format actions PR, changelog 2022-06-22 20:23:15 -04:00
config.go Accumulate incoming messages in a buffered channel 2022-12-23 08:30:47 +11:00
config_test.go Tests, client tests WIP 2021-12-22 14:17:50 +01:00
errors.go Replace interface{} 2022-10-01 16:31:48 -04:00
file_cache.go Delete expired attachments based on mod time instead of DB entry to avoid races 2022-07-08 10:00:04 -04:00
file_cache_test.go Delete expired attachments based on mod time instead of DB entry to avoid races 2022-07-08 10:00:04 -04:00
mailer_emoji.json Fully working email feature 2021-12-25 00:13:09 +01:00
message_cache.go Accumulate incoming messages in a buffered channel 2022-12-23 08:30:47 +11:00
message_cache_test.go Accumulate incoming messages in a buffered channel 2022-12-23 08:30:47 +11:00
ntfy.service Add --trace and --no-log-dates; add docs 2022-06-02 10:50:05 -04:00
server.go Polish async batching 2022-11-16 10:28:20 -05:00
server.yml Docs 2022-11-16 10:33:12 -05:00
server_firebase.go Replace interface{} 2022-10-01 16:31:48 -04:00
server_firebase_test.go refactor visitor IPs and allow exempting IP Ranges 2022-10-05 16:04:42 -05:00
server_matrix.go Reformatting, make update 2022-09-27 12:37:02 -04:00
server_matrix_test.go refactor visitor IPs and allow exempting IP Ranges 2022-10-05 16:04:42 -05:00
server_test.go Accumulate incoming messages in a buffered channel 2022-12-23 08:30:47 +11:00
smtp_sender.go refactor visitor IPs and allow exempting IP Ranges 2022-10-05 16:04:42 -05:00
smtp_sender_test.go WIP 2021-12-27 16:39:28 +01:00
smtp_server.go So much logging 2022-06-01 23:24:44 -04:00
smtp_server_test.go Docs and Matrix tests 2022-06-16 11:40:56 -04:00
topic.go Call subscriber funtions in individual goroutines 2022-06-22 13:52:49 -04:00
types.go refactor visitor IPs and allow exempting IP Ranges 2022-10-05 16:04:42 -05:00
util.go Return HTTP 500 on Matrix discovery GET if base-url not configured; log entire HTTP request when TRACE enabled 2022-06-19 21:25:35 -04:00
util_test.go Return HTTP 500 on Matrix discovery GET if base-url not configured; log entire HTTP request when TRACE enabled 2022-06-19 21:25:35 -04:00
visitor.go refactor visitor IPs and allow exempting IP Ranges 2022-10-05 16:04:42 -05:00