ntfy/server
Nick Farrell 9f2311b98e
Avoid blocking incoming messages.
Through the additional of a secondary signalling channel,
whenever there are sufficient messages in the queue to fill a "batch",
the processing goroutine will be immediately woken. Because the
buffered channel has double that capacity, requests should never be
delayed unless the server is actually overloaded.

This preserves the improvements of the previous commit, meaning that,
even when a batch size of 10 and a batch delay of 1s is used:
- there is no background load; if no messages are received, the server
  is dormant;
- if no message was received in the last second, a new message will be
  immediately processed;
- if a small number of messages are received after the first, the
  additional messages will be collected and processed in a single
  transaction after the configured delay;
- if enough new messages arrive to fill a batch (ie 10 in this example),
  they will be immediately processed, freeing up capacity for more
  messages;
- if up to double the configured number of messages arrive in a burst,
  there will be sufficient capacity to cache them immediately,
  regardless of how slowly the mysql server commits each transaction
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 Avoid blocking incoming messages. 2022-12-23 08:30:47 +11:00
message_cache_test.go Avoid blocking incoming messages. 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