aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2023-12-16 19:13:40 -0800
committerGarrett D'Amore <garrett@damore.org>2023-12-16 21:11:15 -0800
commitac40f5d7d0babb1b93ef398f88adec1c44c187eb (patch)
treefdb2290a027762d4f4ac6e81920975ff55552990 /include
parentcc5851749cfd87bdf446d7be4193c758a36d2232 (diff)
downloadnng-ac40f5d7d0babb1b93ef398f88adec1c44c187eb.tar.gz
nng-ac40f5d7d0babb1b93ef398f88adec1c44c187eb.tar.bz2
nng-ac40f5d7d0babb1b93ef398f88adec1c44c187eb.zip
fixes #1663 Request/Reply Protocol Throughput and Scalability
This eliminates the req protocols use of nni_timer (and setting a single timer node per request. This was problematic because it devolves into O(n^2) as we wind up inserting timer nodes and having to scan the list for the timer node. The solution is to use a single scan - stop worrying about insertion, but instead use a coarse granularity timer (defaults to 1 second) for retries. Then do the O(n) scan just once per interval. A new option, NNG_OPT_REQ_RESENDTICK, can be used to change the tick interval for cases (like unit tests) where more fine grained timing is required.
Diffstat (limited to 'include')
-rw-r--r--include/nng/protocol/reqrep0/req.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/nng/protocol/reqrep0/req.h b/include/nng/protocol/reqrep0/req.h
index 3ed80216..0c9fde3f 100644
--- a/include/nng/protocol/reqrep0/req.h
+++ b/include/nng/protocol/reqrep0/req.h
@@ -31,6 +31,7 @@ NNG_DECL int nng_req0_open_raw(nng_socket *);
#define NNG_REQ0_PEER_NAME "rep"
#define NNG_OPT_REQ_RESENDTIME "req:resend-time"
+#define NNG_OPT_REQ_RESENDTICK "req:resend-tick"
#ifdef __cplusplus
}