agoo 2.0.5 → 2.1.0
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +5 -2
- data/ext/agoo/agoo.c +35 -2
- data/ext/agoo/con.c +184 -86
- data/ext/agoo/con.h +4 -2
- data/ext/agoo/debug.c +2 -0
- data/ext/agoo/debug.h +2 -0
- data/ext/agoo/page.c +1 -0
- data/ext/agoo/pub.c +31 -27
- data/ext/agoo/pub.h +10 -11
- data/ext/agoo/request.c +5 -4
- data/ext/agoo/request.h +2 -1
- data/ext/agoo/res.c +3 -1
- data/ext/agoo/res.h +4 -1
- data/ext/agoo/server.c +55 -26
- data/ext/agoo/server.h +5 -3
- data/ext/agoo/subject.c +51 -0
- data/ext/agoo/subject.h +17 -0
- data/ext/agoo/text.c +18 -1
- data/ext/agoo/text.h +1 -0
- data/ext/agoo/upgraded.c +264 -57
- data/ext/agoo/upgraded.h +27 -1
- data/ext/agoo/websocket.c +10 -9
- data/lib/agoo/version.rb +1 -1
- metadata +4 -6
- data/ext/agoo/ccache.c +0 -301
- data/ext/agoo/ccache.h +0 -53
- data/ext/agoo/subscription.c +0 -54
- data/ext/agoo/subscription.h +0 -18
data/ext/agoo/subscription.c
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
// Copyright (c) 2018, Peter Ohler, All rights reserved.
|
2
|
-
|
3
|
-
#include "pub.h"
|
4
|
-
#include "queue.h"
|
5
|
-
#include "server.h"
|
6
|
-
#include "subscription.h"
|
7
|
-
|
8
|
-
static VALUE subscription_class = Qundef;
|
9
|
-
|
10
|
-
VALUE
|
11
|
-
subscription_new(uint64_t cid, uint64_t id, VALUE handler) {
|
12
|
-
Subscription s = ALLOC(struct _Subscription);
|
13
|
-
|
14
|
-
s->cid = cid;
|
15
|
-
s->id = id;
|
16
|
-
s->handler = handler;
|
17
|
-
s->self = Data_Wrap_Struct(subscription_class, NULL, xfree, s);
|
18
|
-
|
19
|
-
return s->self;
|
20
|
-
}
|
21
|
-
|
22
|
-
/* Document-method: close
|
23
|
-
*
|
24
|
-
* call-seq: close()
|
25
|
-
*
|
26
|
-
* Close or unsubscribe a subscription.
|
27
|
-
*/
|
28
|
-
static VALUE
|
29
|
-
subscription_close(VALUE self) {
|
30
|
-
Subscription s = DATA_PTR(self);
|
31
|
-
|
32
|
-
if (0 != s->cid && 0 != s->id) {
|
33
|
-
Pub p = pub_unsubscribe(s->cid, s->id);
|
34
|
-
|
35
|
-
queue_push(&the_server.pub_queue, (void*)p);
|
36
|
-
queue_wakeup(&the_server.pub_queue);
|
37
|
-
s->cid = 0;
|
38
|
-
s->id = 0;
|
39
|
-
}
|
40
|
-
return Qnil;
|
41
|
-
}
|
42
|
-
|
43
|
-
/* Document-class: Agoo::Subscription
|
44
|
-
*
|
45
|
-
* The handle on a subscriptionscription used to register interest in messages
|
46
|
-
* published on a subscriptionject. Published messages are delivered to Javascript
|
47
|
-
* clients.
|
48
|
-
*/
|
49
|
-
void
|
50
|
-
subscription_init(VALUE mod) {
|
51
|
-
subscription_class = rb_define_class_under(mod, "Subscription", rb_cObject);
|
52
|
-
|
53
|
-
rb_define_method(subscription_class, "close", subscription_close, 0);
|
54
|
-
}
|
data/ext/agoo/subscription.h
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
// Copyright (c) 2018, Peter Ohler, All rights reserved.
|
2
|
-
|
3
|
-
#ifndef __AGOO_SUBSCRIPTION_H__
|
4
|
-
#define __AGOO_SUBSCRIPTION_H__
|
5
|
-
|
6
|
-
#include <ruby.h>
|
7
|
-
|
8
|
-
typedef struct _Subscription {
|
9
|
-
VALUE self;
|
10
|
-
uint64_t cid;
|
11
|
-
uint64_t id;
|
12
|
-
VALUE handler;
|
13
|
-
} *Subscription;
|
14
|
-
|
15
|
-
extern void subscription_init(VALUE mod);
|
16
|
-
extern VALUE subscription_new(uint64_t cid, uint64_t id, VALUE handler);
|
17
|
-
|
18
|
-
#endif // __AGOO_SUBSCRIPTION_H__
|