lwtarantool 0.0.2

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.
Files changed (107) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +84 -0
  3. data/ext/lwtarantool/conn.c +314 -0
  4. data/ext/lwtarantool/depend +23 -0
  5. data/ext/lwtarantool/errors.c +24 -0
  6. data/ext/lwtarantool/extconf.rb +8 -0
  7. data/ext/lwtarantool/lwtarantool.c +12 -0
  8. data/ext/lwtarantool/lwtarantool.h +38 -0
  9. data/ext/lwtarantool/request.c +124 -0
  10. data/ext/lwtarantool/vendor/msgpuck/CMakeLists.txt +73 -0
  11. data/ext/lwtarantool/vendor/msgpuck/hints.c +674 -0
  12. data/ext/lwtarantool/vendor/msgpuck/msgpuck.c +375 -0
  13. data/ext/lwtarantool/vendor/msgpuck/msgpuck.h +2195 -0
  14. data/ext/lwtarantool/vendor/msgpuck/test/CMakeLists.txt +25 -0
  15. data/ext/lwtarantool/vendor/msgpuck/test/msgpuck.c +1126 -0
  16. data/ext/lwtarantool/vendor/msgpuck/test/test.c +105 -0
  17. data/ext/lwtarantool/vendor/msgpuck/test/test.h +123 -0
  18. data/ext/lwtarantool/vendor/tarantool-c/CMakeLists.txt +89 -0
  19. data/ext/lwtarantool/vendor/tarantool-c/cmake/FindMsgPuck.cmake +18 -0
  20. data/ext/lwtarantool/vendor/tarantool-c/cmake/FindSphinx.cmake +10 -0
  21. data/ext/lwtarantool/vendor/tarantool-c/doc/CMakeLists.txt +15 -0
  22. data/ext/lwtarantool/vendor/tarantool-c/doc/source/example.c +340 -0
  23. data/ext/lwtarantool/vendor/tarantool-c/include/CMakeLists.txt +6 -0
  24. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tarantool.h +67 -0
  25. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_auth.h +72 -0
  26. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_buf.h +88 -0
  27. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_call.h +83 -0
  28. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_delete.h +52 -0
  29. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_execute.h +24 -0
  30. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_insert.h +62 -0
  31. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_io.h +67 -0
  32. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_iob.h +62 -0
  33. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_iter.h +301 -0
  34. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_mem.h +102 -0
  35. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_net.h +242 -0
  36. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_object.h +248 -0
  37. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_opt.h +138 -0
  38. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_ping.h +49 -0
  39. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_proto.h +295 -0
  40. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_reply.h +204 -0
  41. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_request.h +377 -0
  42. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_schema.h +165 -0
  43. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_select.h +59 -0
  44. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_stream.h +79 -0
  45. data/ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_update.h +226 -0
  46. data/ext/lwtarantool/vendor/tarantool-c/include/tp.h +1998 -0
  47. data/ext/lwtarantool/vendor/tarantool-c/test/CMakeLists.txt +36 -0
  48. data/ext/lwtarantool/vendor/tarantool-c/test/common.c +233 -0
  49. data/ext/lwtarantool/vendor/tarantool-c/test/common.h +28 -0
  50. data/ext/lwtarantool/vendor/tarantool-c/test/plain_test.c +152 -0
  51. data/ext/lwtarantool/vendor/tarantool-c/test/tarantool_call.c +57 -0
  52. data/ext/lwtarantool/vendor/tarantool-c/test/tarantool_disconnect.c +31 -0
  53. data/ext/lwtarantool/vendor/tarantool-c/test/tarantool_tcp.c +840 -0
  54. data/ext/lwtarantool/vendor/tarantool-c/test/tarantool_unix.c +384 -0
  55. data/ext/lwtarantool/vendor/tarantool-c/test/test.c +72 -0
  56. data/ext/lwtarantool/vendor/tarantool-c/test/test.h +94 -0
  57. data/ext/lwtarantool/vendor/tarantool-c/test/tnt_assoc.c +6 -0
  58. data/ext/lwtarantool/vendor/tarantool-c/test/tnt_assoc.h +67 -0
  59. data/ext/lwtarantool/vendor/tarantool-c/third_party/PMurHash.c +317 -0
  60. data/ext/lwtarantool/vendor/tarantool-c/third_party/PMurHash.h +68 -0
  61. data/ext/lwtarantool/vendor/tarantool-c/third_party/base64.c +300 -0
  62. data/ext/lwtarantool/vendor/tarantool-c/third_party/base64.h +91 -0
  63. data/ext/lwtarantool/vendor/tarantool-c/third_party/mhash.h +589 -0
  64. data/ext/lwtarantool/vendor/tarantool-c/third_party/sha1.c +219 -0
  65. data/ext/lwtarantool/vendor/tarantool-c/third_party/sha1.h +24 -0
  66. data/ext/lwtarantool/vendor/tarantool-c/third_party/uri.c +6528 -0
  67. data/ext/lwtarantool/vendor/tarantool-c/third_party/uri.h +81 -0
  68. data/ext/lwtarantool/vendor/tarantool-c/tnt/CMakeLists.txt +83 -0
  69. data/ext/lwtarantool/vendor/tarantool-c/tnt/pmatomic.h +494 -0
  70. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_assoc.c +9 -0
  71. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_assoc.h +172 -0
  72. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_auth.c +118 -0
  73. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_buf.c +171 -0
  74. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_call.c +79 -0
  75. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_delete.c +52 -0
  76. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_execute.c +60 -0
  77. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_insert.c +60 -0
  78. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_io.c +520 -0
  79. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_iob.c +75 -0
  80. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_iter.c +293 -0
  81. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_mem.c +82 -0
  82. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_net.c +336 -0
  83. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_object.c +476 -0
  84. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_opt.c +117 -0
  85. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_ping.c +38 -0
  86. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_proto_internal.h +43 -0
  87. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_reply.c +300 -0
  88. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_request.c +336 -0
  89. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_schema.c +334 -0
  90. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_select.c +58 -0
  91. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_stream.c +71 -0
  92. data/ext/lwtarantool/vendor/tarantool-c/tnt/tnt_update.c +247 -0
  93. data/ext/lwtarantool/vendor/tarantool-c/tntrpl/CMakeLists.txt +69 -0
  94. data/ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_dir.c +173 -0
  95. data/ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_dir.h +58 -0
  96. data/ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_log.c +329 -0
  97. data/ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_log.h +119 -0
  98. data/ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_rpl.c +189 -0
  99. data/ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_rpl.h +47 -0
  100. data/ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_snapshot.c +163 -0
  101. data/ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_snapshot.h +50 -0
  102. data/ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_xlog.c +163 -0
  103. data/ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_xlog.h +50 -0
  104. data/lib/lwtarantool/connection.rb +84 -0
  105. data/lib/lwtarantool/request.rb +58 -0
  106. data/lib/lwtarantool.rb +23 -0
  107. metadata +164 -0
@@ -0,0 +1,163 @@
1
+
2
+ /*
3
+ * Redistribution and use in source and binary forms, with or
4
+ * without modification, are permitted provided that the following
5
+ * conditions are met:
6
+ *
7
+ * 1. Redistributions of source code must retain the above
8
+ * copyright notice, this list of conditions and the
9
+ * following disclaimer.
10
+ *
11
+ * 2. Redistributions in binary form must reproduce the above
12
+ * copyright notice, this list of conditions and the following
13
+ * disclaimer in the documentation and/or other materials
14
+ * provided with the distribution.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND
17
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
20
+ * <COPYRIGHT HOLDER> OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27
+ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28
+ * SUCH DAMAGE.
29
+ */
30
+
31
+ #include <stdlib.h>
32
+ #include <stdio.h>
33
+ #include <stdarg.h>
34
+ #include <string.h>
35
+
36
+ #include <unistd.h>
37
+ #include <fcntl.h>
38
+ #include <errno.h>
39
+
40
+ #include <third_party/crc32.h>
41
+
42
+ #include <tarantool.h>
43
+ #include <tnt_log.h>
44
+ #include <tnt_xlog.h>
45
+
46
+ static void tnt_xlog_free(struct tnt_stream *s) {
47
+ struct tnt_stream_xlog *sx = TNT_SXLOG_CAST(s);
48
+ tnt_log_close(&sx->log);
49
+ tnt_mem_free(s->data);
50
+ s->data = NULL;
51
+ }
52
+
53
+ static int
54
+ tnt_xlog_request(struct tnt_stream *s, struct tnt_request *r)
55
+ {
56
+ struct tnt_stream_xlog *sx = TNT_SXLOG_CAST(s);
57
+
58
+ struct tnt_log_row *row =
59
+ tnt_log_next_to(&sx->log, (union tnt_log_value*)r);
60
+
61
+ if (row == NULL && tnt_log_error(&sx->log) == TNT_LOG_EOK)
62
+ return 1;
63
+
64
+ return (row) ? 0: -1;
65
+ }
66
+
67
+ /*
68
+ * tnt_xlog()
69
+ *
70
+ * create and initialize xlog stream;
71
+ *
72
+ * s - stream pointer, maybe NULL
73
+ *
74
+ * if stream pointer is NULL, then new stream will be created.
75
+ *
76
+ * returns stream pointer, or NULL on error.
77
+ */
78
+ struct tnt_stream *tnt_xlog(struct tnt_stream *s)
79
+ {
80
+ int allocated = s == NULL;
81
+ s = tnt_stream_init(s);
82
+ if (s == NULL)
83
+ return NULL;
84
+ /* allocating stream data */
85
+ s->data = tnt_mem_alloc(sizeof(struct tnt_stream_xlog));
86
+ if (s->data == NULL) {
87
+ if (allocated)
88
+ tnt_stream_free(s);
89
+ return NULL;
90
+ }
91
+ memset(s->data, 0, sizeof(struct tnt_stream_xlog));
92
+ /* initializing interfaces */
93
+ s->read = NULL;
94
+ s->read_request = tnt_xlog_request;
95
+ s->read_reply = NULL;
96
+ s->read_tuple = NULL;
97
+ s->write = NULL;
98
+ s->writev = NULL;
99
+ s->free = tnt_xlog_free;
100
+ /* initializing internal data */
101
+ return s;
102
+ }
103
+
104
+ /*
105
+ * tnt_xlog_open()
106
+ *
107
+ * open xlog file and associate it with stream;
108
+ *
109
+ * s - xlog stream pointer
110
+ *
111
+ * returns 0 on success, or -1 on error.
112
+ */
113
+ int tnt_xlog_open(struct tnt_stream *s, char *file) {
114
+ struct tnt_stream_xlog *sx = TNT_SXLOG_CAST(s);
115
+ return tnt_log_open(&sx->log, file, TNT_LOG_XLOG);
116
+ }
117
+
118
+ /*
119
+ * tnt_xlog_close()
120
+ *
121
+ * close xlog stream;
122
+ *
123
+ * s - xlog stream pointer
124
+ *
125
+ * returns 0 on success, or -1 on error.
126
+ */
127
+ void tnt_xlog_close(struct tnt_stream *s) {
128
+ struct tnt_stream_xlog *sx = TNT_SXLOG_CAST(s);
129
+ tnt_log_close(&sx->log);
130
+ }
131
+
132
+ /*
133
+ * tnt_xlog_error()
134
+ *
135
+ * get stream error status;
136
+ *
137
+ * s - xlog stream pointer
138
+ */
139
+ enum tnt_log_error tnt_xlog_error(struct tnt_stream *s) {
140
+ return TNT_SXLOG_CAST(s)->log.error;
141
+ }
142
+
143
+ /*
144
+ * tnt_xlog_strerror()
145
+ *
146
+ * get stream error status description string;
147
+ *
148
+ * s - xlog stream pointer
149
+ */
150
+ char *tnt_xlog_strerror(struct tnt_stream *s) {
151
+ return tnt_log_strerror(&TNT_SXLOG_CAST(s)->log);
152
+ }
153
+
154
+ /*
155
+ * tnt_xlog_errno()
156
+ *
157
+ * get saved errno;
158
+ *
159
+ * s - xlog stream pointer
160
+ */
161
+ int tnt_xlog_errno(struct tnt_stream *s) {
162
+ return TNT_SXLOG_CAST(s)->log.errno_;
163
+ }
@@ -0,0 +1,50 @@
1
+ #ifndef TNT_XLOG_H_INCLUDED
2
+ #define TNT_XLOG_H_INCLUDED
3
+
4
+ /*
5
+ * Redistribution and use in source and binary forms, with or
6
+ * without modification, are permitted provided that the following
7
+ * conditions are met:
8
+ *
9
+ * 1. Redistributions of source code must retain the above
10
+ * copyright notice, this list of conditions and the
11
+ * following disclaimer.
12
+ *
13
+ * 2. Redistributions in binary form must reproduce the above
14
+ * copyright notice, this list of conditions and the following
15
+ * disclaimer in the documentation and/or other materials
16
+ * provided with the distribution.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND
19
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22
+ * <COPYRIGHT HOLDER> OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
26
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
29
+ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30
+ * SUCH DAMAGE.
31
+ */
32
+
33
+ #include <tarantool/tnt_log.h>
34
+
35
+ struct tnt_stream_xlog {
36
+ struct tnt_log log;
37
+ };
38
+
39
+ #define TNT_SXLOG_CAST(S) ((struct tnt_stream_xlog*)(S)->data)
40
+
41
+ struct tnt_stream *tnt_xlog(struct tnt_stream *s);
42
+
43
+ int tnt_xlog_open(struct tnt_stream *s, char *file);
44
+ void tnt_xlog_close(struct tnt_stream *s);
45
+
46
+ enum tnt_log_error tnt_xlog_error(struct tnt_stream *s);
47
+ char *tnt_xlog_strerror(struct tnt_stream *s);
48
+ int tnt_xlog_errno(struct tnt_stream *s);
49
+
50
+ #endif /* TNT_XLOG_H_INCLUDED */
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'msgpack'
4
+
5
+ module LWTarantool
6
+ # Class for work with Tarantool connections
7
+ class Connection
8
+ # attr_accessor :logger
9
+
10
+ # Call a function in tarantool.
11
+ #
12
+ # Connection can be one-time reestablished in case of fail.
13
+ #
14
+ # @param [String] func the tarantool function for call.
15
+ # @param [Array] args the tarantool function arguments.
16
+ #
17
+ # @example
18
+ # conn.call('box.slab.info', [])
19
+ #
20
+ # @return [LWTarantool::Request] a new request instance.
21
+ #
22
+ # @raise [LWTarantool::ResolvError] destination host can't be resolved.
23
+ # @raise [LWTarantool::TimeoutError] connect timeout reached.
24
+ # @raise [LWTarantool::LoginError] incorrect login or password.
25
+ # @raise [LWTarantool::SystemError] connection failed.
26
+ # @raise [LWTarantool::UnknownError] unknown error.
27
+ #
28
+ def call(func, args)
29
+ mutex.synchronize do
30
+ _connect unless connected?
31
+ _call(func, args.to_msgpack)
32
+ end
33
+ rescue SystemError
34
+ attempt ||= 0
35
+ attempt += 1
36
+ disconnect
37
+ retry if attempt <= 1
38
+ raise
39
+ end
40
+
41
+ #
42
+ # Read a single response from tarantool.
43
+ #
44
+ # Returns request instance and update already exists request object.
45
+ #
46
+ # All active requests will be terminated in case of connection fail.
47
+ #
48
+ # @example
49
+ # conn.call('box.slab.info', [])
50
+ #
51
+ # @return [LWTarantool::Request] a correspond request instance.
52
+ #
53
+ # @raise [LWTarantool::SyncError] incorrect tarantool response.
54
+ # @raise [LWTarantool::SystemError] connection was closed.
55
+ # @raise [LWTarantool::UnknownError] unknown error.
56
+ #
57
+ def read
58
+ mutex.synchronize do
59
+ _read
60
+ end
61
+ rescue SystemError
62
+ disconnect
63
+ raise
64
+ end
65
+
66
+ #
67
+ # Close tarantool connection.
68
+ #
69
+ # All active requests will be terminated.
70
+ #
71
+ # @example
72
+ # conn.disconnect
73
+ #
74
+ def disconnect
75
+ mutex.synchronize do
76
+ _disconnect
77
+ end
78
+ end
79
+
80
+ private
81
+
82
+ attr_reader :mutex
83
+ end
84
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'msgpack'
4
+
5
+ module LWTarantool
6
+ # Class for work with Tarantool requests
7
+ class Request
8
+ #
9
+ # Correspond tarantool connection.
10
+ #
11
+ # @return [LWTarantool::Connection] correspond tarantool connection.
12
+ #
13
+ attr_reader :conn
14
+
15
+ #
16
+ # Wait for request be processed by Tarantool.
17
+ #
18
+ # @example
19
+ # req.wait
20
+ #
21
+ # @raise [LWTarantool::SyncError] incorrect tarantool response.
22
+ # @raise [LWTarantool::SystemError] connection was closed.
23
+ # @raise [LWTarantool::UnknownError] unknown error.
24
+ #
25
+ def wait
26
+ conn.read until ready?
27
+ end
28
+
29
+ #
30
+ # Wait for request processing and return tarantool reponse data.
31
+ #
32
+ # @example
33
+ # req.result
34
+ #
35
+ # @return [Array] response data if request was successfull processed.
36
+ # @return [nil] nil if request failed.
37
+ #
38
+ def result
39
+ wait unless ready?
40
+ res = _result
41
+ MessagePack.unpack(res) unless res.nil?
42
+ end
43
+
44
+ #
45
+ # Wait for request processing and return tarantool error message.
46
+ #
47
+ # @example
48
+ # req.error
49
+ #
50
+ # @return [String] Tarantool error message if request failed.
51
+ # @return [nil] nil if request success.
52
+ #
53
+ def error
54
+ wait unless ready?
55
+ _error
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lwtarantool/lwtarantool'
4
+ require 'lwtarantool/connection'
5
+ require 'lwtarantool/request'
6
+
7
+ ## LWTarantool
8
+ #
9
+ # A modern and simple Tarantool 1.7+ library for Ruby.
10
+ #
11
+ # It doesn't support all tarantool protocol features, the only function calls,
12
+ # but allow work with tarantool in async paradigm.
13
+ #
14
+ module LWTarantool
15
+ #
16
+ # Same as {LWTarantool::Connection#initialize LWTarantool::Connection.new(args)}
17
+ #
18
+ # @return {LWTarantool::Connection}
19
+ #
20
+ def self.new(args)
21
+ LWTarantool::Connection.new(args)
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,164 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lwtarantool
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Alexander Golovko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-05-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: msgpack
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1'
27
+ description: Tarantool client library
28
+ email: ag@wallarm.com
29
+ executables: []
30
+ extensions:
31
+ - ext/lwtarantool/extconf.rb
32
+ extra_rdoc_files: []
33
+ files:
34
+ - README.md
35
+ - ext/lwtarantool/conn.c
36
+ - ext/lwtarantool/depend
37
+ - ext/lwtarantool/errors.c
38
+ - ext/lwtarantool/extconf.rb
39
+ - ext/lwtarantool/lwtarantool.c
40
+ - ext/lwtarantool/lwtarantool.h
41
+ - ext/lwtarantool/request.c
42
+ - ext/lwtarantool/vendor/msgpuck/CMakeLists.txt
43
+ - ext/lwtarantool/vendor/msgpuck/hints.c
44
+ - ext/lwtarantool/vendor/msgpuck/msgpuck.c
45
+ - ext/lwtarantool/vendor/msgpuck/msgpuck.h
46
+ - ext/lwtarantool/vendor/msgpuck/test/CMakeLists.txt
47
+ - ext/lwtarantool/vendor/msgpuck/test/msgpuck.c
48
+ - ext/lwtarantool/vendor/msgpuck/test/test.c
49
+ - ext/lwtarantool/vendor/msgpuck/test/test.h
50
+ - ext/lwtarantool/vendor/tarantool-c/CMakeLists.txt
51
+ - ext/lwtarantool/vendor/tarantool-c/cmake/FindMsgPuck.cmake
52
+ - ext/lwtarantool/vendor/tarantool-c/cmake/FindSphinx.cmake
53
+ - ext/lwtarantool/vendor/tarantool-c/doc/CMakeLists.txt
54
+ - ext/lwtarantool/vendor/tarantool-c/doc/source/example.c
55
+ - ext/lwtarantool/vendor/tarantool-c/include/CMakeLists.txt
56
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tarantool.h
57
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_auth.h
58
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_buf.h
59
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_call.h
60
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_delete.h
61
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_execute.h
62
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_insert.h
63
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_io.h
64
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_iob.h
65
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_iter.h
66
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_mem.h
67
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_net.h
68
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_object.h
69
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_opt.h
70
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_ping.h
71
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_proto.h
72
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_reply.h
73
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_request.h
74
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_schema.h
75
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_select.h
76
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_stream.h
77
+ - ext/lwtarantool/vendor/tarantool-c/include/tarantool/tnt_update.h
78
+ - ext/lwtarantool/vendor/tarantool-c/include/tp.h
79
+ - ext/lwtarantool/vendor/tarantool-c/test/CMakeLists.txt
80
+ - ext/lwtarantool/vendor/tarantool-c/test/common.c
81
+ - ext/lwtarantool/vendor/tarantool-c/test/common.h
82
+ - ext/lwtarantool/vendor/tarantool-c/test/plain_test.c
83
+ - ext/lwtarantool/vendor/tarantool-c/test/tarantool_call.c
84
+ - ext/lwtarantool/vendor/tarantool-c/test/tarantool_disconnect.c
85
+ - ext/lwtarantool/vendor/tarantool-c/test/tarantool_tcp.c
86
+ - ext/lwtarantool/vendor/tarantool-c/test/tarantool_unix.c
87
+ - ext/lwtarantool/vendor/tarantool-c/test/test.c
88
+ - ext/lwtarantool/vendor/tarantool-c/test/test.h
89
+ - ext/lwtarantool/vendor/tarantool-c/test/tnt_assoc.c
90
+ - ext/lwtarantool/vendor/tarantool-c/test/tnt_assoc.h
91
+ - ext/lwtarantool/vendor/tarantool-c/third_party/PMurHash.c
92
+ - ext/lwtarantool/vendor/tarantool-c/third_party/PMurHash.h
93
+ - ext/lwtarantool/vendor/tarantool-c/third_party/base64.c
94
+ - ext/lwtarantool/vendor/tarantool-c/third_party/base64.h
95
+ - ext/lwtarantool/vendor/tarantool-c/third_party/mhash.h
96
+ - ext/lwtarantool/vendor/tarantool-c/third_party/sha1.c
97
+ - ext/lwtarantool/vendor/tarantool-c/third_party/sha1.h
98
+ - ext/lwtarantool/vendor/tarantool-c/third_party/uri.c
99
+ - ext/lwtarantool/vendor/tarantool-c/third_party/uri.h
100
+ - ext/lwtarantool/vendor/tarantool-c/tnt/CMakeLists.txt
101
+ - ext/lwtarantool/vendor/tarantool-c/tnt/pmatomic.h
102
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_assoc.c
103
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_assoc.h
104
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_auth.c
105
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_buf.c
106
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_call.c
107
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_delete.c
108
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_execute.c
109
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_insert.c
110
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_io.c
111
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_iob.c
112
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_iter.c
113
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_mem.c
114
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_net.c
115
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_object.c
116
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_opt.c
117
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_ping.c
118
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_proto_internal.h
119
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_reply.c
120
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_request.c
121
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_schema.c
122
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_select.c
123
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_stream.c
124
+ - ext/lwtarantool/vendor/tarantool-c/tnt/tnt_update.c
125
+ - ext/lwtarantool/vendor/tarantool-c/tntrpl/CMakeLists.txt
126
+ - ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_dir.c
127
+ - ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_dir.h
128
+ - ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_log.c
129
+ - ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_log.h
130
+ - ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_rpl.c
131
+ - ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_rpl.h
132
+ - ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_snapshot.c
133
+ - ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_snapshot.h
134
+ - ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_xlog.c
135
+ - ext/lwtarantool/vendor/tarantool-c/tntrpl/tnt_xlog.h
136
+ - lib/lwtarantool.rb
137
+ - lib/lwtarantool/connection.rb
138
+ - lib/lwtarantool/request.rb
139
+ homepage: http://rubygems.org/gems/lwtarantool
140
+ licenses:
141
+ - MIT
142
+ metadata: {}
143
+ post_install_message:
144
+ rdoc_options: []
145
+ require_paths:
146
+ - lib
147
+ required_ruby_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ required_rubygems_version: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ version: '0'
157
+ requirements: []
158
+ rubyforge_project:
159
+ rubygems_version: 2.2.5
160
+ signing_key:
161
+ specification_version: 4
162
+ summary: Lightweight Tarantool client
163
+ test_files: []
164
+ has_rdoc: