agoo 2.15.10 → 2.15.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +20 -7
- data/ext/agoo/agoo.c +2 -2
- data/ext/agoo/debug.c +2 -2
- data/ext/agoo/domain.c +2 -2
- data/ext/agoo/dtime.c +1 -1
- data/ext/agoo/error_stream.c +1 -1
- data/ext/agoo/gqleval.c +1 -1
- data/ext/agoo/graphql.c +1 -1
- data/ext/agoo/http.c +2 -2
- data/ext/agoo/log.c +9 -9
- data/ext/agoo/page.c +506 -506
- data/ext/agoo/rack_logger.c +1 -1
- data/ext/agoo/rresponse.c +1 -1
- data/ext/agoo/rserver.c +31 -16
- data/lib/agoo/version.rb +1 -1
- data/misc/flymd.md +581 -0
- data/misc/glue-diagram.svg +3 -0
- data/misc/glue.md +25 -0
- data/misc/optimize.md +100 -0
- data/misc/push.md +581 -0
- data/misc/rails.md +174 -0
- data/misc/song.md +268 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37b6b991cfea7d2296391628e8dc47517dd77d430439bcfc23f172fd07c94016
|
4
|
+
data.tar.gz: d70eb6f9acd35ab380befa04a449687e151482bb7f37e2b8cdd2db647f8f7e92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed6f0947338d3498acde38b4507c63267c6f3ea5ac0c71a4c77e996c017895cf453175e1b11f79b6b5d47d742cb94d4a53095db986ae9dca8799b8ff5142003e
|
7
|
+
data.tar.gz: 471a82403e18363d1c71fb46e5d296ef203afa785d58ac6bf771bb135dd6a99275b3508e1133d935535c46447108d3d7f9c9a181c2465f62bb43e8381af2721a
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,20 @@
|
|
2
2
|
|
3
3
|
All changes to the Agoo gem are documented here. Releases follow semantic versioning.
|
4
4
|
|
5
|
+
## [2.15.12] - 2024-07-28
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
|
9
|
+
- When multiple threads are specified and the main thread exits worker
|
10
|
+
threads not exit as well.
|
11
|
+
|
12
|
+
## [2.15.11] - 2024-06-04
|
13
|
+
|
14
|
+
### Fixed
|
15
|
+
|
16
|
+
- The server root parameter (asset root) no longer raises and error when `nil`.
|
17
|
+
- The server path handling behavior around the use of `/` has been improved.
|
18
|
+
|
5
19
|
## [2.15.10] - 2024-04-14
|
6
20
|
|
7
21
|
### Added
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ A High Performance HTTP Server for Ruby
|
|
13
13
|
```ruby
|
14
14
|
require 'agoo'
|
15
15
|
|
16
|
-
Agoo::Server.init(6464, 'root')
|
16
|
+
Agoo::Server.init(6464, './root')
|
17
17
|
|
18
18
|
class MyHandler
|
19
19
|
def call(req)
|
@@ -50,7 +50,7 @@ class Schema
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
Agoo::Server.init(6464, 'root', thread_count: 1, graphql: '/graphql')
|
53
|
+
Agoo::Server.init(6464, './root', thread_count: 1, graphql: '/graphql')
|
54
54
|
Agoo::Server.start()
|
55
55
|
Agoo::GraphQL.schema(Schema.new) {
|
56
56
|
Agoo::GraphQL.load(%^type Query { hello: String }^)
|
@@ -68,7 +68,7 @@ sleep
|
|
68
68
|
gem install agoo
|
69
69
|
```
|
70
70
|
|
71
|
-
## Using
|
71
|
+
## Using Agoo as a server for Rails
|
72
72
|
|
73
73
|
As agoo supports rack compatible apps you can use it for rails applications:
|
74
74
|
|
@@ -101,16 +101,29 @@ of fetches per second. A simple hello world Ruby handler at over 100,000
|
|
101
101
|
requests per second on a desktop computer. That places Agoo at about 85 times
|
102
102
|
faster than Sinatra and 1000 times faster than Rails. In both cases the
|
103
103
|
latency was two orders of magnitude lower or more. Checkout the
|
104
|
-
[benchmarks](
|
105
|
-
the benchmarks had to use a C program called
|
106
|
-
[Perfer](https://github.com/ohler55/perfer) to hit the Agoo limits. Ruby
|
107
|
-
benchmarks driver could not push Agoo hard enough.
|
104
|
+
[benchmarks](https://web-frameworks-benchmark.netlify.app/result?l=ruby).
|
108
105
|
|
109
106
|
Agoo supports the [Ruby rack API](https://rack.github.io) which allows for the
|
110
107
|
use of rack compatible gems such as Hanami and Rails. Agoo also supports WebSockets and SSE.
|
111
108
|
|
112
109
|
Agoo is not available on Windows.
|
113
110
|
|
111
|
+
## Getting Started
|
112
|
+
|
113
|
+
Some examples can be found in the `example` directory. Some other
|
114
|
+
documented walk through examples of using Agoo are in the `misc`
|
115
|
+
directory. These examples are described in markdown files. Some like
|
116
|
+
the [song](misc/song.md) example are simple while others like the
|
117
|
+
[glue](misc/glue.md) are more complex. The documented walk through
|
118
|
+
examples are:
|
119
|
+
|
120
|
+
- [flymd](misc/flymd.md) - realtime push
|
121
|
+
- [glue](misc/glue.md) - publish and subscribe
|
122
|
+
- [optimize](misc/optimize.md) - optimizing static asset use
|
123
|
+
- [push](misc/push.md) - push with Rack
|
124
|
+
- [rails](misc/rails.md) - faster rails
|
125
|
+
- [song](misc/song.md) - fun and simple GraphQL
|
126
|
+
|
114
127
|
## News
|
115
128
|
|
116
129
|
- Version 2.11.0 supports GraphQL subscriptions. TLS (SSL,HTTPS)
|
data/ext/agoo/agoo.c
CHANGED
@@ -30,7 +30,7 @@ sig_atomic_t agoo_stop = 0;
|
|
30
30
|
static atomic_int shutdown_started = AGOO_ATOMIC_INT_INIT(0);
|
31
31
|
|
32
32
|
void
|
33
|
-
agoo_shutdown() {
|
33
|
+
agoo_shutdown(void) {
|
34
34
|
if (0 == atomic_fetch_add(&shutdown_started, 1)) {
|
35
35
|
rserver_shutdown(Qnil);
|
36
36
|
agoo_log_close();
|
@@ -99,7 +99,7 @@ sig_handler(int sig) {
|
|
99
99
|
* agoo is a Japanese word for a type of flying fish.
|
100
100
|
*/
|
101
101
|
void
|
102
|
-
Init_agoo() {
|
102
|
+
Init_agoo(void) {
|
103
103
|
VALUE mod = rb_define_module("Agoo");
|
104
104
|
|
105
105
|
rlog_init(mod);
|
data/ext/agoo/debug.c
CHANGED
@@ -291,7 +291,7 @@ update_reps(Rep reps, Rec r) {
|
|
291
291
|
}
|
292
292
|
|
293
293
|
static void
|
294
|
-
print_stats() {
|
294
|
+
print_stats(void) {
|
295
295
|
printf("\n--- Memory Usage Report --------------------------------------------------------\n");
|
296
296
|
pthread_mutex_lock(&lock);
|
297
297
|
|
@@ -320,7 +320,7 @@ print_stats() {
|
|
320
320
|
#endif
|
321
321
|
|
322
322
|
void
|
323
|
-
debug_report() {
|
323
|
+
debug_report(void) {
|
324
324
|
#ifdef MEM_DEBUG
|
325
325
|
print_stats();
|
326
326
|
#endif
|
data/ext/agoo/domain.c
CHANGED
@@ -19,7 +19,7 @@ typedef struct _domain {
|
|
19
19
|
static Domain domains = NULL;
|
20
20
|
|
21
21
|
bool
|
22
|
-
agoo_domain_use() {
|
22
|
+
agoo_domain_use(void) {
|
23
23
|
return NULL != domains;
|
24
24
|
}
|
25
25
|
|
@@ -128,7 +128,7 @@ agoo_domain_resolve(const char *host, char *buf, size_t blen) {
|
|
128
128
|
}
|
129
129
|
|
130
130
|
void
|
131
|
-
agoo_domain_cleanup() {
|
131
|
+
agoo_domain_cleanup(void) {
|
132
132
|
Domain d;
|
133
133
|
|
134
134
|
while (NULL != (d = domains)) {
|
data/ext/agoo/dtime.c
CHANGED
data/ext/agoo/error_stream.c
CHANGED
data/ext/agoo/gqleval.c
CHANGED
@@ -317,7 +317,7 @@ gql_eval_sels(agooErr err, gqlDoc doc, gqlRef ref, gqlField field, gqlSel sels,
|
|
317
317
|
}
|
318
318
|
|
319
319
|
gqlType
|
320
|
-
gql_root_type() {
|
320
|
+
gql_root_type(void) {
|
321
321
|
if (NULL == _gql_root_type && NULL != gql_type_func) {
|
322
322
|
_gql_root_type = gql_type_func(gql_root);
|
323
323
|
}
|
data/ext/agoo/graphql.c
CHANGED
data/ext/agoo/http.c
CHANGED
@@ -465,7 +465,7 @@ key_set(const char *key) {
|
|
465
465
|
}
|
466
466
|
|
467
467
|
void
|
468
|
-
agoo_http_init() {
|
468
|
+
agoo_http_init(void) {
|
469
469
|
const char **kp = header_keys;
|
470
470
|
|
471
471
|
memset(&key_cache, 0, sizeof(struct _cache));
|
@@ -475,7 +475,7 @@ agoo_http_init() {
|
|
475
475
|
}
|
476
476
|
|
477
477
|
void
|
478
|
-
agoo_http_cleanup() {
|
478
|
+
agoo_http_cleanup(void) {
|
479
479
|
Slot *sp = key_cache.buckets;
|
480
480
|
Slot s;
|
481
481
|
Slot n;
|
data/ext/agoo/log.c
CHANGED
@@ -74,7 +74,7 @@ find_color(const char *name) {
|
|
74
74
|
}
|
75
75
|
|
76
76
|
static bool
|
77
|
-
agoo_log_queue_empty() {
|
77
|
+
agoo_log_queue_empty(void) {
|
78
78
|
agooLogEntry head = atomic_load(&agoo_log.head);
|
79
79
|
agooLogEntry next = head + 1;
|
80
80
|
|
@@ -88,7 +88,7 @@ agoo_log_queue_empty() {
|
|
88
88
|
}
|
89
89
|
|
90
90
|
static int
|
91
|
-
agoo_log_listen() {
|
91
|
+
agoo_log_listen(void) {
|
92
92
|
if (0 == agoo_log.rsock) {
|
93
93
|
int fd[2];
|
94
94
|
|
@@ -105,7 +105,7 @@ agoo_log_listen() {
|
|
105
105
|
}
|
106
106
|
|
107
107
|
static void
|
108
|
-
agoo_log_release() {
|
108
|
+
agoo_log_release(void) {
|
109
109
|
char buf[8];
|
110
110
|
|
111
111
|
// clear pipe
|
@@ -233,7 +233,7 @@ classic_write(agooLogEntry e, FILE *file) {
|
|
233
233
|
// Remove all file with sequence numbers higher than max_files. max_files is
|
234
234
|
// max number of archived version. It does not include the primary.
|
235
235
|
static void
|
236
|
-
remove_old_logs() {
|
236
|
+
remove_old_logs(void) {
|
237
237
|
struct dirent *de;
|
238
238
|
long seq;
|
239
239
|
char *end;
|
@@ -271,7 +271,7 @@ remove_old_logs() {
|
|
271
271
|
}
|
272
272
|
|
273
273
|
void
|
274
|
-
agoo_log_rotate() {
|
274
|
+
agoo_log_rotate(void) {
|
275
275
|
char from[1060];
|
276
276
|
char to[1060];
|
277
277
|
int seq;
|
@@ -356,7 +356,7 @@ agoo_log_flush(double timeout) {
|
|
356
356
|
}
|
357
357
|
|
358
358
|
void
|
359
|
-
agoo_log_open_file() {
|
359
|
+
agoo_log_open_file(void) {
|
360
360
|
char path[1500];
|
361
361
|
|
362
362
|
if (agoo_log.with_pid) {
|
@@ -379,7 +379,7 @@ agoo_log_open_file() {
|
|
379
379
|
}
|
380
380
|
|
381
381
|
void
|
382
|
-
agoo_log_close() {
|
382
|
+
agoo_log_close(void) {
|
383
383
|
agoo_log.done = true;
|
384
384
|
// TBD wake up loop like push does
|
385
385
|
agoo_log_cat_on(NULL, false);
|
@@ -450,7 +450,7 @@ agoo_log_cat_find(const char *label) {
|
|
450
450
|
|
451
451
|
#ifdef CLOCK_REALTIME
|
452
452
|
int64_t
|
453
|
-
agoo_now_nano() {
|
453
|
+
agoo_now_nano(void) {
|
454
454
|
struct timespec ts;
|
455
455
|
|
456
456
|
clock_gettime(CLOCK_REALTIME, &ts);
|
@@ -459,7 +459,7 @@ agoo_now_nano() {
|
|
459
459
|
}
|
460
460
|
#else
|
461
461
|
int64_t
|
462
|
-
agoo_now_nano() {
|
462
|
+
agoo_now_nano(void) {
|
463
463
|
struct timeval tv;
|
464
464
|
struct timezone tz;
|
465
465
|
|