iodine 0.6.5 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of iodine might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +4 -4
- data/SPEC-Websocket-Draft.md +3 -6
- data/bin/mustache.rb +128 -0
- data/examples/test_template.mustache +16 -0
- data/ext/iodine/fio.c +9397 -0
- data/ext/iodine/fio.h +4723 -0
- data/ext/iodine/fio_ary.h +353 -54
- data/ext/iodine/fio_cli.c +351 -361
- data/ext/iodine/fio_cli.h +84 -105
- data/ext/iodine/fio_hashmap.h +70 -16
- data/ext/iodine/fio_json_parser.h +35 -24
- data/ext/iodine/fio_siphash.c +104 -4
- data/ext/iodine/fio_siphash.h +18 -2
- data/ext/iodine/fio_str.h +1218 -0
- data/ext/iodine/fio_tmpfile.h +1 -1
- data/ext/iodine/fiobj.h +13 -8
- data/ext/iodine/fiobj4sock.h +6 -8
- data/ext/iodine/fiobj_ary.c +107 -17
- data/ext/iodine/fiobj_ary.h +36 -4
- data/ext/iodine/fiobj_data.c +146 -127
- data/ext/iodine/fiobj_data.h +25 -23
- data/ext/iodine/fiobj_hash.c +7 -7
- data/ext/iodine/fiobj_hash.h +6 -5
- data/ext/iodine/fiobj_json.c +20 -17
- data/ext/iodine/fiobj_json.h +5 -5
- data/ext/iodine/fiobj_mem.h +71 -0
- data/ext/iodine/fiobj_mustache.c +310 -0
- data/ext/iodine/fiobj_mustache.h +40 -0
- data/ext/iodine/fiobj_numbers.c +199 -94
- data/ext/iodine/fiobj_numbers.h +7 -7
- data/ext/iodine/fiobj_str.c +142 -333
- data/ext/iodine/fiobj_str.h +65 -55
- data/ext/iodine/fiobject.c +49 -11
- data/ext/iodine/fiobject.h +40 -39
- data/ext/iodine/http.c +382 -190
- data/ext/iodine/http.h +124 -80
- data/ext/iodine/http1.c +99 -127
- data/ext/iodine/http1.h +5 -5
- data/ext/iodine/http1_parser.c +3 -2
- data/ext/iodine/http1_parser.h +2 -2
- data/ext/iodine/http_internal.c +14 -12
- data/ext/iodine/http_internal.h +25 -19
- data/ext/iodine/iodine.c +37 -18
- data/ext/iodine/iodine.h +4 -0
- data/ext/iodine/iodine_caller.c +9 -2
- data/ext/iodine/iodine_caller.h +2 -0
- data/ext/iodine/iodine_connection.c +82 -117
- data/ext/iodine/iodine_defer.c +57 -50
- data/ext/iodine/iodine_defer.h +0 -1
- data/ext/iodine/iodine_fiobj2rb.h +4 -2
- data/ext/iodine/iodine_helpers.c +4 -4
- data/ext/iodine/iodine_http.c +25 -32
- data/ext/iodine/iodine_json.c +2 -1
- data/ext/iodine/iodine_mustache.c +423 -0
- data/ext/iodine/iodine_mustache.h +6 -0
- data/ext/iodine/iodine_pubsub.c +48 -153
- data/ext/iodine/iodine_pubsub.h +5 -4
- data/ext/iodine/iodine_rack_io.c +7 -5
- data/ext/iodine/iodine_store.c +16 -13
- data/ext/iodine/iodine_tcp.c +26 -34
- data/ext/iodine/mustache_parser.h +1085 -0
- data/ext/iodine/redis_engine.c +740 -646
- data/ext/iodine/redis_engine.h +13 -15
- data/ext/iodine/resp_parser.h +11 -5
- data/ext/iodine/websocket_parser.h +13 -13
- data/ext/iodine/websockets.c +240 -393
- data/ext/iodine/websockets.h +52 -113
- data/lib/iodine.rb +1 -1
- data/lib/iodine/mustache.rb +140 -0
- data/lib/iodine/version.rb +1 -1
- metadata +15 -28
- data/ext/iodine/defer.c +0 -566
- data/ext/iodine/defer.h +0 -148
- data/ext/iodine/evio.c +0 -26
- data/ext/iodine/evio.h +0 -161
- data/ext/iodine/evio_callbacks.c +0 -26
- data/ext/iodine/evio_epoll.c +0 -251
- data/ext/iodine/evio_kqueue.c +0 -194
- data/ext/iodine/facil.c +0 -2325
- data/ext/iodine/facil.h +0 -616
- data/ext/iodine/fio_base64.c +0 -277
- data/ext/iodine/fio_base64.h +0 -71
- data/ext/iodine/fio_llist.h +0 -257
- data/ext/iodine/fio_mem.c +0 -675
- data/ext/iodine/fio_mem.h +0 -143
- data/ext/iodine/fio_random.c +0 -248
- data/ext/iodine/fio_random.h +0 -45
- data/ext/iodine/fio_sha1.c +0 -362
- data/ext/iodine/fio_sha1.h +0 -107
- data/ext/iodine/fio_sha2.c +0 -842
- data/ext/iodine/fio_sha2.h +0 -169
- data/ext/iodine/pubsub.c +0 -867
- data/ext/iodine/pubsub.h +0 -221
- data/ext/iodine/sock.c +0 -1366
- data/ext/iodine/sock.h +0 -566
- data/ext/iodine/spnlock.inc +0 -111
data/ext/iodine/websockets.h
CHANGED
@@ -7,18 +7,13 @@ Feel free to copy, use and enjoy according to the license provided.
|
|
7
7
|
#ifndef H_WEBSOCKETS_H
|
8
8
|
#define H_WEBSOCKETS_H
|
9
9
|
|
10
|
-
#include
|
10
|
+
#include <http.h>
|
11
11
|
|
12
12
|
/* support C++ */
|
13
13
|
#ifdef __cplusplus
|
14
14
|
extern "C" {
|
15
15
|
#endif
|
16
16
|
|
17
|
-
/**
|
18
|
-
The protocol / service identifier.
|
19
|
-
*/
|
20
|
-
extern char *WEBSOCKET_ID_STR;
|
21
|
-
|
22
17
|
/** used internally: attaches the Websocket protocol to the socket. */
|
23
18
|
void websocket_attach(intptr_t uuid, http_settings_s *http_settings,
|
24
19
|
websocket_settings_s *args, void *data, size_t length);
|
@@ -28,34 +23,36 @@ Websocket information
|
|
28
23
|
***************************************************************************** */
|
29
24
|
|
30
25
|
/** Returns the opaque user data associated with the websocket. */
|
31
|
-
void *
|
26
|
+
void *websocket_udata_get(ws_s *ws);
|
32
27
|
|
33
28
|
/**
|
34
|
-
Sets the opaque user data associated with the websocket.
|
35
|
-
|
36
|
-
Returns the old value, if any.
|
37
|
-
*/
|
29
|
+
* Sets the opaque user data associated with the websocket.
|
30
|
+
*
|
31
|
+
* Returns the old value, if any.
|
32
|
+
*/
|
38
33
|
void *websocket_udata_set(ws_s *ws, void *udata);
|
39
34
|
|
40
35
|
/**
|
41
|
-
Returns the underlying socket UUID.
|
42
|
-
|
43
|
-
This is only relevant for collecting the protocol object from outside of
|
44
|
-
websocket events, as the socket shouldn't be written to.
|
45
|
-
*/
|
36
|
+
* Returns the underlying socket UUID.
|
37
|
+
*
|
38
|
+
* This is only relevant for collecting the protocol object from outside of
|
39
|
+
* websocket events, as the socket shouldn't be written to.
|
40
|
+
*/
|
46
41
|
intptr_t websocket_uuid(ws_s *ws);
|
47
42
|
|
48
43
|
/**
|
49
|
-
|
50
|
-
|
51
|
-
|
44
|
+
* Returns 1 if the WebSocket connection is in Client mode (connected to a
|
45
|
+
* remote server) and 0 if the connection is in Server mode (a connection
|
46
|
+
* established using facil.io's HTTP server).
|
47
|
+
*/
|
48
|
+
uint8_t websocket_is_client(ws_s *ws);
|
52
49
|
|
53
50
|
/* *****************************************************************************
|
54
51
|
Websocket Connection Management (write / close)
|
55
52
|
***************************************************************************** */
|
56
53
|
|
57
54
|
/** Writes data to the websocket. Returns -1 on failure (0 on success). */
|
58
|
-
int websocket_write(ws_s *ws,
|
55
|
+
int websocket_write(ws_s *ws, fio_str_info_s msg, uint8_t is_text);
|
59
56
|
/** Closes a websocket connection. */
|
60
57
|
void websocket_close(ws_s *ws);
|
61
58
|
|
@@ -70,48 +67,32 @@ Supports pub/sub engines (see {pubsub.h}) that can connect to a backend service
|
|
70
67
|
such as Redis.
|
71
68
|
|
72
69
|
The default pub/sub engine (if `NULL` or unspecified) will publish the messages
|
73
|
-
to the process cluster (all the processes in `
|
70
|
+
to the process cluster (all the processes in `fio_run`).
|
74
71
|
|
75
72
|
To publish to a channel, use the API provided in {pubsub.h}.
|
76
73
|
***************************************************************************** */
|
77
74
|
|
78
|
-
/** Pub/sub engine type. Engine documentation is in `pubsub.h` */
|
79
|
-
typedef struct pubsub_engine_s pubsub_engine_s;
|
80
|
-
|
81
|
-
/** Incoming pub/sub messages will be passed along using this data structure. */
|
82
|
-
typedef struct {
|
83
|
-
/** the websocket receiving the message. */
|
84
|
-
ws_s *ws;
|
85
|
-
/** the Websocket pub/sub subscription ID. */
|
86
|
-
uintptr_t subscription_id;
|
87
|
-
/** the channel where the message was published. */
|
88
|
-
FIOBJ channel;
|
89
|
-
/** the published message. */
|
90
|
-
FIOBJ message;
|
91
|
-
/** user opaque data. */
|
92
|
-
void *udata;
|
93
|
-
} websocket_pubsub_notification_s;
|
94
|
-
|
95
75
|
/** Possible arguments for the {websocket_subscribe} function. */
|
96
76
|
struct websocket_subscribe_s {
|
97
77
|
/** the websocket receiving the message. REQUIRED. */
|
98
78
|
ws_s *ws;
|
99
79
|
/** the channel where the message was published. */
|
100
|
-
|
80
|
+
fio_str_info_s channel;
|
101
81
|
/**
|
102
82
|
* The callback that handles pub/sub notifications.
|
103
83
|
*
|
104
84
|
* Default: send directly to websocket client.
|
105
85
|
*/
|
106
|
-
void (*on_message)(
|
86
|
+
void (*on_message)(ws_s *ws, fio_str_info_s channel, fio_str_info_s msg,
|
87
|
+
void *udata);
|
107
88
|
/**
|
108
89
|
* An optional cleanup callback for the `udata`.
|
109
90
|
*/
|
110
91
|
void (*on_unsubscribe)(void *udata);
|
111
92
|
/** User opaque data, passed along to the notification. */
|
112
93
|
void *udata;
|
113
|
-
/**
|
114
|
-
|
94
|
+
/** An optional callback for pattern matching. */
|
95
|
+
fio_match_fn match;
|
115
96
|
/**
|
116
97
|
* When using client forwarding (no `on_message` callback), this indicates if
|
117
98
|
* messages should be sent to the client as binary blobs, which is the safest
|
@@ -151,17 +132,6 @@ uintptr_t websocket_subscribe(struct websocket_subscribe_s args);
|
|
151
132
|
#define websocket_subscribe(wbsckt, ...) \
|
152
133
|
websocket_subscribe((struct websocket_subscribe_s){.ws = wbsckt, __VA_ARGS__})
|
153
134
|
|
154
|
-
/**
|
155
|
-
* Finds an existing subscription (in case the subscription ID wasn't saved).
|
156
|
-
* See {struct websocket_subscribe_s} for possible arguments.
|
157
|
-
*
|
158
|
-
* Returns the existing subscription's ID (if exists) or 0 (no subscription).
|
159
|
-
*/
|
160
|
-
uintptr_t websocket_find_sub(struct websocket_subscribe_s args);
|
161
|
-
|
162
|
-
#define websocket_find_sub(wbsckt, ...) \
|
163
|
-
websocket_find_sub((struct websocket_subscribe_s){.ws = wbsckt, __VA_ARGS__})
|
164
|
-
|
165
135
|
/**
|
166
136
|
* Unsubscribes from a channel.
|
167
137
|
*
|
@@ -172,71 +142,40 @@ uintptr_t websocket_find_sub(struct websocket_subscribe_s args);
|
|
172
142
|
*/
|
173
143
|
void websocket_unsubscribe(ws_s *ws, uintptr_t subscription_id);
|
174
144
|
|
175
|
-
|
176
|
-
|
177
|
-
|
145
|
+
/** Optimize generic broadcasts, for use in websocket_optimize4broadcasts. */
|
146
|
+
#define WEBSOCKET_OPTIMIZE_PUBSUB (-32)
|
147
|
+
/** Optimize text broadcasts, for use in websocket_optimize4broadcasts. */
|
148
|
+
#define WEBSOCKET_OPTIMIZE_PUBSUB_TEXT (-33)
|
149
|
+
/** Optimize binary broadcasts, for use in websocket_optimize4broadcasts. */
|
150
|
+
#define WEBSOCKET_OPTIMIZE_PUBSUB_BINARY (-34)
|
178
151
|
|
179
|
-
/** The named arguments for `websocket_each` */
|
180
|
-
struct websocket_each_args_s {
|
181
|
-
/** The websocket originating the task. It will be excluded for the loop. */
|
182
|
-
ws_s *origin;
|
183
|
-
/** The task (function) to be performed. This is required. */
|
184
|
-
void (*task)(ws_s *ws_target, void *arg);
|
185
|
-
/** User opaque data to be passed along. */
|
186
|
-
void *arg;
|
187
|
-
/** The on_finish callback is always called. Good for cleanup. */
|
188
|
-
void (*on_finish)(ws_s *origin, void *arg);
|
189
|
-
};
|
190
152
|
/**
|
191
|
-
*
|
153
|
+
* Enables (or disables) broadcast optimizations.
|
192
154
|
*
|
193
|
-
*
|
194
|
-
*
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
websocket_each((struct websocket_each_args_s){__VA_ARGS__})
|
200
|
-
|
201
|
-
/**
|
202
|
-
* DEPRECATION NOTICE: this function will be removed in favor of pub/sub logic.
|
155
|
+
* When using WebSocket pub/sub system is originally optimized for either
|
156
|
+
* non-direct transmission (messages are handled by callbacks) or direct
|
157
|
+
* transmission to 1-3 clients per channel (on average), meaning that the
|
158
|
+
* majority of the messages are meant for a single recipient (or multiple
|
159
|
+
* callback recipients) and only some are expected to be directly transmitted to
|
160
|
+
* a group.
|
203
161
|
*
|
204
|
-
*
|
205
|
-
*
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
* application is the server). */
|
220
|
-
uint8_t as_client;
|
221
|
-
/** A filter callback, allowing us to exclude some clients.
|
222
|
-
* Should return 1 to send data and 0 to exclude. */
|
223
|
-
uint8_t (*filter)(ws_s *ws_to, void *arg);
|
224
|
-
/** A callback called once all the data was sent. */
|
225
|
-
void (*on_finished)(ws_s *ws_origin, void *arg);
|
226
|
-
/** A user specified argumernt passed to each of the callbacks. */
|
227
|
-
void *arg;
|
228
|
-
};
|
229
|
-
/**
|
230
|
-
Writes data to each websocket connection that shares the same process
|
231
|
-
(except the originating `ws_s` connection which is allowed to be NULL).
|
232
|
-
|
233
|
-
Accepts a sing `struct websocket_write_each_args_s` argument. See the struct
|
234
|
-
details for possible arguments.
|
162
|
+
* However, when most messages are intended for direct transmission to more than
|
163
|
+
* 3 clients (on average), certain optimizations can be made to improve memory
|
164
|
+
* consumption (minimize duplication or WebSocket network data).
|
165
|
+
*
|
166
|
+
* This function allows enablement (or disablement) of these optimizations.
|
167
|
+
* These optimizations include:
|
168
|
+
*
|
169
|
+
* * WEBSOCKET_OPTIMIZE_PUBSUB - optimize all direct transmission messages,
|
170
|
+
* best attempt to detect Text vs. Binary data.
|
171
|
+
* * WEBSOCKET_OPTIMIZE_PUBSUB_TEXT - optimize direct pub/sub text messages.
|
172
|
+
* * WEBSOCKET_OPTIMIZE_PUBSUB_BINARY - optimize direct pub/sub binary messages.
|
173
|
+
*
|
174
|
+
* Note: to disable an optimization it should be disabled the same amount of
|
175
|
+
* times it was enabled - multiple optimization enablements for the same type
|
176
|
+
* are merged, but reference counted (disabled when reference is zero).
|
235
177
|
*/
|
236
|
-
int
|
237
|
-
websocket_write_each(struct websocket_write_each_args_s args);
|
238
|
-
#define websocket_write_each(...) \
|
239
|
-
websocket_write_each((struct websocket_write_each_args_s){__VA_ARGS__})
|
178
|
+
void websocket_optimize4broadcasts(intptr_t type, int enable);
|
240
179
|
|
241
180
|
#ifdef __cplusplus
|
242
181
|
} /* extern "C" */
|
data/lib/iodine.rb
CHANGED
@@ -3,7 +3,7 @@ require 'socket'
|
|
3
3
|
require 'iodine/version'
|
4
4
|
require 'iodine/iodine'
|
5
5
|
|
6
|
-
# Iodine is an HTTP / WebSocket server as well as an Evented Network Tool Library.
|
6
|
+
# Iodine is an HTTP / WebSocket server as well as an Evented Network Tool Library. In essense, Iodine is a Ruby port for the [facil.io](http://facil.io) C library.
|
7
7
|
#
|
8
8
|
# Here is a simple telnet based echo server using Iodine (see full list at {Iodine::Connection}):
|
9
9
|
#
|
@@ -0,0 +1,140 @@
|
|
1
|
+
module Iodine
|
2
|
+
# Iodine includes a strict and extra safe Mustache templating engine.
|
3
|
+
#
|
4
|
+
# The Iodine Mustache templating engine provides increased XSS protection through agressive HTML escaping. It's also faster than the original (Ruby based) Mustache templating engine.
|
5
|
+
#
|
6
|
+
# Another difference is that the Iodine Mustache templating engine always loads the templates from the disk, allowing for patial template path resolution.
|
7
|
+
#
|
8
|
+
# There's no monkey-patch for `mustache` Ruby gem since the API is incompatible.
|
9
|
+
#
|
10
|
+
# You can benchmark the Iodine Mustache performance and decide if you wish to switch from the Ruby implementation.
|
11
|
+
#
|
12
|
+
# require 'benchmark/ips'
|
13
|
+
# require 'mustache'
|
14
|
+
# require 'iodine'
|
15
|
+
#
|
16
|
+
# def benchmark_mustache
|
17
|
+
# # benchmark code was copied, in part, from:
|
18
|
+
# # https://github.com/mustache/mustache/blob/master/benchmarks/render_collection_benchmark.rb
|
19
|
+
# template = """
|
20
|
+
# {{#products}}
|
21
|
+
# <div class='product_brick'>
|
22
|
+
# <div class='container'>
|
23
|
+
# <div class='element'>
|
24
|
+
# <img src='images/{{image}}' class='product_miniature' />
|
25
|
+
# </div>
|
26
|
+
# <div class='element description'>
|
27
|
+
# <a href={{url}} class='product_name block bold'>
|
28
|
+
# {{external_index}}
|
29
|
+
# </a>
|
30
|
+
# </div>
|
31
|
+
# </div>
|
32
|
+
# </div>
|
33
|
+
# {{/products}}
|
34
|
+
# """
|
35
|
+
#
|
36
|
+
# IO.write "test_template.mustache", template
|
37
|
+
#
|
38
|
+
# data_1 = {
|
39
|
+
# products: [ {
|
40
|
+
# :external_index=>"This <product> should've been \"properly\" escaped.",
|
41
|
+
# :url=>"/products/7",
|
42
|
+
# :image=>"products/product.jpg"
|
43
|
+
# } ]
|
44
|
+
# }
|
45
|
+
#
|
46
|
+
# data_10 = {
|
47
|
+
# products: []
|
48
|
+
# }
|
49
|
+
#
|
50
|
+
# 10.times do
|
51
|
+
# data_10[:products] << {
|
52
|
+
# :external_index=>"product",
|
53
|
+
# :url=>"/products/7",
|
54
|
+
# :image=>"products/product.jpg"
|
55
|
+
# }
|
56
|
+
# end
|
57
|
+
#
|
58
|
+
# data_100 = {
|
59
|
+
# products: []
|
60
|
+
# }
|
61
|
+
#
|
62
|
+
# 100.times do
|
63
|
+
# data_100[:products] << {
|
64
|
+
# :external_index=>"product",
|
65
|
+
# :url=>"/products/7",
|
66
|
+
# :image=>"products/product.jpg"
|
67
|
+
# }
|
68
|
+
# end
|
69
|
+
#
|
70
|
+
# data_1000 = {
|
71
|
+
# products: []
|
72
|
+
# }
|
73
|
+
#
|
74
|
+
# 1000.times do
|
75
|
+
# data_1000[:products] << {
|
76
|
+
# :external_index=>"product",
|
77
|
+
# :url=>"/products/7",
|
78
|
+
# :image=>"products/product.jpg"
|
79
|
+
# }
|
80
|
+
# end
|
81
|
+
#
|
82
|
+
# data_1000_escaped = {
|
83
|
+
# products: []
|
84
|
+
# }
|
85
|
+
#
|
86
|
+
# 1000.times do
|
87
|
+
# data_1000_escaped[:products] << {
|
88
|
+
# :external_index=>"This <product> should've been \"properly\" escaped.",
|
89
|
+
# :url=>"/products/7",
|
90
|
+
# :image=>"products/product.jpg"
|
91
|
+
# }
|
92
|
+
# end
|
93
|
+
#
|
94
|
+
# view = Mustache.new
|
95
|
+
# view.template = template
|
96
|
+
# view.render # Call render once so the template will be compiled
|
97
|
+
# iodine_view = Iodine::Mustache.new("test_template")
|
98
|
+
#
|
99
|
+
# puts "Ruby Mustache rendering (and HTML escaping) results in:",
|
100
|
+
# view.render(data_1), "",
|
101
|
+
# "Notice that Iodine::Mustache rendering (and HTML escaping) results in agressive escaping:",
|
102
|
+
# iodine_view.render(data_1), "", "----"
|
103
|
+
#
|
104
|
+
# # return;
|
105
|
+
#
|
106
|
+
# Benchmark.ips do |x|
|
107
|
+
# x.report("Ruby Mustache render list of 10") do |times|
|
108
|
+
# view.render(data_10)
|
109
|
+
# end
|
110
|
+
# x.report("Iodine::Mustache render list of 10") do |times|
|
111
|
+
# iodine_view.render(data_10)
|
112
|
+
# end
|
113
|
+
#
|
114
|
+
# x.report("Ruby Mustache render list of 100") do |times|
|
115
|
+
# view.render(data_100)
|
116
|
+
# end
|
117
|
+
# x.report("Iodine::Mustache render list of 100") do |times|
|
118
|
+
# iodine_view.render(data_100)
|
119
|
+
# end
|
120
|
+
#
|
121
|
+
# x.report("Ruby Mustache render list of 1000") do |times|
|
122
|
+
# view.render(data_1000)
|
123
|
+
# end
|
124
|
+
# x.report("Iodine::Mustache render list of 1000") do |times|
|
125
|
+
# iodine_view.render(data_1000)
|
126
|
+
# end
|
127
|
+
#
|
128
|
+
# x.report("Ruby Mustache render list of 1000 with escaped data") do |times|
|
129
|
+
# view.render(data_1000_escaped)
|
130
|
+
# end
|
131
|
+
# x.report("Iodine::Mustache render list of 1000 with escaped data") do |times|
|
132
|
+
# iodine_view.render(data_1000_escaped)
|
133
|
+
# end
|
134
|
+
# end
|
135
|
+
# end
|
136
|
+
#
|
137
|
+
# benchmark_mustache
|
138
|
+
class Mustache
|
139
|
+
end
|
140
|
+
end
|
data/lib/iodine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iodine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boaz Segev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- bin/http-big
|
138
138
|
- bin/http-hello
|
139
139
|
- bin/http-playground
|
140
|
+
- bin/mustache.rb
|
140
141
|
- bin/playground
|
141
142
|
- bin/poc/Gemfile.lock
|
142
143
|
- bin/poc/README.md
|
@@ -157,35 +158,19 @@ files:
|
|
157
158
|
- examples/pubsub_engine.ru
|
158
159
|
- examples/redis.ru
|
159
160
|
- examples/shootout.ru
|
161
|
+
- examples/test_template.mustache
|
160
162
|
- exe/iodine
|
161
|
-
- ext/iodine/defer.c
|
162
|
-
- ext/iodine/defer.h
|
163
|
-
- ext/iodine/evio.c
|
164
|
-
- ext/iodine/evio.h
|
165
|
-
- ext/iodine/evio_callbacks.c
|
166
|
-
- ext/iodine/evio_epoll.c
|
167
|
-
- ext/iodine/evio_kqueue.c
|
168
163
|
- ext/iodine/extconf.rb
|
169
|
-
- ext/iodine/
|
170
|
-
- ext/iodine/
|
164
|
+
- ext/iodine/fio.c
|
165
|
+
- ext/iodine/fio.h
|
171
166
|
- ext/iodine/fio_ary.h
|
172
|
-
- ext/iodine/fio_base64.c
|
173
|
-
- ext/iodine/fio_base64.h
|
174
167
|
- ext/iodine/fio_cli.c
|
175
168
|
- ext/iodine/fio_cli.h
|
176
169
|
- ext/iodine/fio_hashmap.h
|
177
170
|
- ext/iodine/fio_json_parser.h
|
178
|
-
- ext/iodine/fio_llist.h
|
179
|
-
- ext/iodine/fio_mem.c
|
180
|
-
- ext/iodine/fio_mem.h
|
181
|
-
- ext/iodine/fio_random.c
|
182
|
-
- ext/iodine/fio_random.h
|
183
|
-
- ext/iodine/fio_sha1.c
|
184
|
-
- ext/iodine/fio_sha1.h
|
185
|
-
- ext/iodine/fio_sha2.c
|
186
|
-
- ext/iodine/fio_sha2.h
|
187
171
|
- ext/iodine/fio_siphash.c
|
188
172
|
- ext/iodine/fio_siphash.h
|
173
|
+
- ext/iodine/fio_str.h
|
189
174
|
- ext/iodine/fio_tmpfile.h
|
190
175
|
- ext/iodine/fiobj.h
|
191
176
|
- ext/iodine/fiobj4sock.h
|
@@ -197,6 +182,9 @@ files:
|
|
197
182
|
- ext/iodine/fiobj_hash.h
|
198
183
|
- ext/iodine/fiobj_json.c
|
199
184
|
- ext/iodine/fiobj_json.h
|
185
|
+
- ext/iodine/fiobj_mem.h
|
186
|
+
- ext/iodine/fiobj_mustache.c
|
187
|
+
- ext/iodine/fiobj_mustache.h
|
200
188
|
- ext/iodine/fiobj_numbers.c
|
201
189
|
- ext/iodine/fiobj_numbers.h
|
202
190
|
- ext/iodine/fiobj_str.c
|
@@ -227,6 +215,8 @@ files:
|
|
227
215
|
- ext/iodine/iodine_http.h
|
228
216
|
- ext/iodine/iodine_json.c
|
229
217
|
- ext/iodine/iodine_json.h
|
218
|
+
- ext/iodine/iodine_mustache.c
|
219
|
+
- ext/iodine/iodine_mustache.h
|
230
220
|
- ext/iodine/iodine_pubsub.c
|
231
221
|
- ext/iodine/iodine_pubsub.h
|
232
222
|
- ext/iodine/iodine_rack_io.c
|
@@ -235,14 +225,10 @@ files:
|
|
235
225
|
- ext/iodine/iodine_store.h
|
236
226
|
- ext/iodine/iodine_tcp.c
|
237
227
|
- ext/iodine/iodine_tcp.h
|
238
|
-
- ext/iodine/
|
239
|
-
- ext/iodine/pubsub.h
|
228
|
+
- ext/iodine/mustache_parser.h
|
240
229
|
- ext/iodine/redis_engine.c
|
241
230
|
- ext/iodine/redis_engine.h
|
242
231
|
- ext/iodine/resp_parser.h
|
243
|
-
- ext/iodine/sock.c
|
244
|
-
- ext/iodine/sock.h
|
245
|
-
- ext/iodine/spnlock.inc
|
246
232
|
- ext/iodine/websocket_parser.h
|
247
233
|
- ext/iodine/websockets.c
|
248
234
|
- ext/iodine/websockets.h
|
@@ -250,6 +236,7 @@ files:
|
|
250
236
|
- lib/iodine.rb
|
251
237
|
- lib/iodine/connection.rb
|
252
238
|
- lib/iodine/json.rb
|
239
|
+
- lib/iodine/mustache.rb
|
253
240
|
- lib/iodine/pubsub.rb
|
254
241
|
- lib/iodine/rack_utils.rb
|
255
242
|
- lib/iodine/version.rb
|
@@ -281,7 +268,7 @@ requirements:
|
|
281
268
|
- Ruby >= 2.2.2 required for Rack 2.
|
282
269
|
- Ruby >= 2.4.0 recommended.
|
283
270
|
rubyforge_project:
|
284
|
-
rubygems_version: 2.7.
|
271
|
+
rubygems_version: 2.7.7
|
285
272
|
signing_key:
|
286
273
|
specification_version: 4
|
287
274
|
summary: iodine - a fast HTTP / Websocket Server with Pub/Sub support, optimized for
|