tigerbeetle 0.0.2 → 0.0.3
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 +5 -0
- data/README.md +23 -0
- data/ext/tb_client/extconf.rb +3 -2
- data/ext/tb_client/pkg.tar.gz +0 -0
- data/lib/tigerbeetle/client.rb +1 -2
- data/lib/tigerbeetle/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fcbf6ee3840a30076501bc9afa231f601b9ffcd3740ba476919014e18a1eaab
|
4
|
+
data.tar.gz: 44825b4988b8c928c6e85a79f6539111036eb07d0a6d92309d398747e288ac5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56c7c962577de854c3c9289450a05ee06ed462e7443c00c96d05c77ac2ba2d1c132931dbb8b5598a84bdca4b6a228b6c2459e3c371f3494eb1ab7536d10c25ef
|
7
|
+
data.tar.gz: a634fb7d8f076208498a75c6dae6946a6961f27d40515d1567ff0537f9d609d6cd317e49573b555be268825a6fb1455329d21dbb8939161570c4a55a60744b96
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -76,6 +76,29 @@ client.create_accounts(
|
|
76
76
|
*More on how to approach this — https://docs.tigerbeetle.com/coding/data-modeling/#id.*
|
77
77
|
|
78
78
|
|
79
|
+
## Async
|
80
|
+
|
81
|
+
All the lower level calls executed by the client are non-blocking. However, since async calls are
|
82
|
+
much less common in Ruby, these are made blocking by default. In order to use the client
|
83
|
+
asynchronously all you need to do is provide your own callback to any method on the client:
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
# default blocking call
|
87
|
+
result = client.lookup_accounts(100)
|
88
|
+
result # [#<struct TigerBeetle::Account id=100, ... >]
|
89
|
+
|
90
|
+
# async non-blocking call
|
91
|
+
client.lookup_accounts(100) do |result|
|
92
|
+
result # [#<struct TigerBeetle::Account id=100, ... >]
|
93
|
+
end
|
94
|
+
```
|
95
|
+
|
96
|
+
*In the example above the first call will block until TigerBeetle responds and the return value of
|
97
|
+
the call will contain the result. The second call however will return `nil` straight away (and keep
|
98
|
+
executing your code) while calling the provided block only once TigerBeetle has responded, passing
|
99
|
+
in the result as an argument to the block.*
|
100
|
+
|
101
|
+
|
79
102
|
## Contributing
|
80
103
|
|
81
104
|
We'd love your help building the TigerBeetle Ruby gem.
|
data/ext/tb_client/extconf.rb
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
require 'mkmf'
|
3
3
|
|
4
4
|
makefile_path = File.join('Makefile')
|
5
|
-
client_version = '0.16.
|
5
|
+
client_version = '0.16.40'
|
6
|
+
min_client_version = '0.16.37'
|
6
7
|
tar_package = 'pkg.tar.gz'
|
7
8
|
|
8
9
|
makefile = ''
|
@@ -12,7 +13,7 @@ if find_executable('zig') && File.exist?('./tigerbeetle/build.zig')
|
|
12
13
|
all:
|
13
14
|
\techo "Compiling native TB client from the source"
|
14
15
|
\tzig version
|
15
|
-
\tunset -v DESTDIR && cd ./tigerbeetle && zig build clients:c -Dconfig-release=#{client_version} -Dconfig-release-client-min=#{
|
16
|
+
\tunset -v DESTDIR && cd ./tigerbeetle && zig build clients:c -Dconfig-release=#{client_version} -Dconfig-release-client-min=#{min_client_version}
|
16
17
|
\n\n
|
17
18
|
install:
|
18
19
|
\tcp -rf ./tigerbeetle/src/clients/c/lib ./pkg
|
data/ext/tb_client/pkg.tar.gz
CHANGED
Binary file
|
data/lib/tigerbeetle/client.rb
CHANGED
@@ -153,10 +153,9 @@ module TigerBeetle
|
|
153
153
|
|
154
154
|
def callback(client_id, packet, timestamp, result_ptr, result_len)
|
155
155
|
request_id = packet[:user_data].read_uint64
|
156
|
-
request = inflight_requests
|
156
|
+
request = inflight_requests.delete(request_id)
|
157
157
|
result = deserialize(result_ptr, request.converter, result_len)
|
158
158
|
request.block.call(result)
|
159
|
-
inflight_requests.delete(request_id)
|
160
159
|
end
|
161
160
|
|
162
161
|
def submit_request(operation, request, request_converter, response_converter, &block)
|
data/lib/tigerbeetle/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tigerbeetle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony D
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|