agoo 2.11.2 → 2.11.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of agoo might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df1bb00da0c9e4622be8beab3f1f6e1e72944ebd499c59be4708a406497398e5
4
- data.tar.gz: 919371ceccd840f0bd281ae010f1478764e76ca4660d1160b3b1c324e5f862f9
3
+ metadata.gz: a06b72b1b88165e3952488f15143a60d49896e52e32228ff06c3b92ae102b5d3
4
+ data.tar.gz: fb74877d9d3d00bdd187d49bd32a266b622c781c9aa8ef7c4663f8adcdc4ec9f
5
5
  SHA512:
6
- metadata.gz: 6a964aaf5a16e046f245d4da7e13852e5b996628fcd293343ce8ac57bbf8ca38b658282681e7c8e38b33c19546516adf5e3c148a5a9000b942de90438742f752
7
- data.tar.gz: b5334140835783165e52f716217079739ab1460e7bda78e3f0dd0925b86885583b9143222befde5d206543838b7cc8a1127e6a4915c1a04df08821b7b80a4def
6
+ metadata.gz: b312fc44371fa01d76573afa0e0b12c0362407cecd6eaf7ed3bf0da92e1b0ed2c86a2b6a7b3b1e35a0f21b181c5f701611ba93906a76ec9190fe9a9d6d09a041
7
+ data.tar.gz: 06b476c1e3dc1a6ab43a37ce5077f5747f6b6d890a6bcae56923e42278e7a04356c057ea25b0fd1f5fc6f9e5cf503d06fd5f7b19af0664232c6efa1e9613e678
@@ -4,6 +4,12 @@ All changes to the Agoo gem are documented here. Releases follow semantic versio
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [2.11.3] - [2019-11-02]
8
+
9
+ Benchamark options
10
+
11
+ - An option for polling timeout added. Trade off CPU use with reponsiveness.
12
+
7
13
  ## [2.11.2] - [2019-10-20]
8
14
 
9
15
  Coerce improvements
@@ -14,6 +14,7 @@ end
14
14
  # Adding the __attribute__ flag only works with gcc compilers and even then it
15
15
  # does not work to check args with varargs so just remove the check.
16
16
  CONFIG['warnflags'].slice!(/ -Wsuggest-attribute=format/)
17
+ CONFIG['warnflags'].slice!(/ -Wdeclaration-after-statement/)
17
18
 
18
19
  have_header('stdatomic.h')
19
20
  #have_header('sys/epoll.h')
@@ -62,6 +62,7 @@ static ID to_i_id;
62
62
 
63
63
  static const char err500[] = "HTTP/1.1 500 Internal Server Error\r\n";
64
64
 
65
+ static double poll_timeout = 0.1;
65
66
  struct _rServer the_rserver = {};
66
67
 
67
68
  static void
@@ -129,6 +130,15 @@ configure(agooErr err, int port, const char *root, VALUE options) {
129
130
  rb_raise(rb_eArgError, "thread_count must be between 1 and %d.", MAX_WORKERS);
130
131
  }
131
132
  }
133
+ if (Qnil != (v = rb_hash_lookup(options, ID2SYM(rb_intern("poll_timeout"))))) {
134
+ double timeout = rb_num2dbl(v);
135
+
136
+ if (0.0001 <= timeout || timeout < 1.0) {
137
+ poll_timeout = timeout;
138
+ } else {
139
+ rb_raise(rb_eArgError, "poll_timeout must be between 0.0001 and 1.0.");
140
+ }
141
+ }
132
142
  if (Qnil != (v = rb_hash_lookup(options, ID2SYM(rb_intern("max_push_pending"))))) {
133
143
  int mpp = FIX2INT(v);
134
144
 
@@ -270,6 +280,8 @@ configure(agooErr err, int port, const char *root, VALUE options) {
270
280
  *
271
281
  * - *:worker_count* [_Integer_] number of workers to fork. Defaults to one which is not to fork.
272
282
  *
283
+ * - *:poll_timeout* [_Float_] timeout seconds when polling. Default is 0.1. Lower gives faster response times but uses more CPU.
284
+ *
273
285
  * - *:bind* [_String_|_Array_] a binding or array of binds. Examples are: "http ://127.0.0.1:6464", "unix:///tmp/agoo.socket", "http ://[::1]:6464, or to not restrict the address "http ://:6464".
274
286
  *
275
287
  * - *:graphql* [_String_] path to GraphQL endpoint if support for GraphQL is desired.
@@ -735,7 +747,7 @@ process_loop(void *ptr) {
735
747
 
736
748
  atomic_fetch_add(&agoo_server.running, 1);
737
749
  while (agoo_server.active) {
738
- if (NULL != (req = (agooReq)agoo_queue_pop(&agoo_server.eval_queue, 0.1))) {
750
+ if (NULL != (req = (agooReq)agoo_queue_pop(&agoo_server.eval_queue, poll_timeout))) {
739
751
  handle_protected(req, true);
740
752
  agoo_req_destroy(req);
741
753
  }
@@ -743,6 +755,7 @@ process_loop(void *ptr) {
743
755
  agoo_shutdown();
744
756
  break;
745
757
  }
758
+ agoo_queue_wakeup(&agoo_server.con_queue); // TBD remove if it doesn't speed up the response time
746
759
  }
747
760
  atomic_fetch_sub(&agoo_server.running, 1);
748
761
 
@@ -811,7 +824,7 @@ rserver_start(VALUE self) {
811
824
  agooReq req;
812
825
 
813
826
  while (agoo_server.active) {
814
- if (NULL != (req = (agooReq)agoo_queue_pop(&agoo_server.eval_queue, 0.1))) {
827
+ if (NULL != (req = (agooReq)agoo_queue_pop(&agoo_server.eval_queue, poll_timeout))) {
815
828
  handle_protected(req, false);
816
829
  agoo_req_destroy(req);
817
830
  } else {
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Agoo
3
3
  # Agoo version.
4
- VERSION = '2.11.2'
4
+ VERSION = '2.11.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.2
4
+ version: 2.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ohler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-20 00:00:00.000000000 Z
11
+ date: 2019-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj