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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a43ba782e05b5f19597449072629a92c1d3116d17b7290fa3ac944287cb4aa43
4
- data.tar.gz: 4be7ab09feaca3f520fcb0d1ba2f98e1836cc81011fb54a5c240086b1dda4a0a
3
+ metadata.gz: 9fcbf6ee3840a30076501bc9afa231f601b9ffcd3740ba476919014e18a1eaab
4
+ data.tar.gz: 44825b4988b8c928c6e85a79f6539111036eb07d0a6d92309d398747e288ac5d
5
5
  SHA512:
6
- metadata.gz: 86cbf91c466a9c3b6811239bf6d56835dfa50e381524a3e2f36f5d01409a2d2679ec6a88f938d9df545b7eba88e1c4e51b64333b547aad27089b3bbbe0aa1749
7
- data.tar.gz: f2ed940ae715bf9c5c8dad92e2886069bcd67c2d3ecfb6b77567284adbaf5875f814c8d999509f2671cc300973178689a0758dcdf69afa8f5c206cf092f09d5e
6
+ metadata.gz: 56c7c962577de854c3c9289450a05ee06ed462e7443c00c96d05c77ac2ba2d1c132931dbb8b5598a84bdca4b6a228b6c2459e3c371f3494eb1ab7536d10c25ef
7
+ data.tar.gz: a634fb7d8f076208498a75c6dae6946a6961f27d40515d1567ff0537f9d609d6cd317e49573b555be268825a6fb1455329d21dbb8939161570c4a55a60744b96
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.3
4
+
5
+ - Bug fixes
6
+ - Based on TigerBeetle 0.16.40
7
+
3
8
  ## 0.0.2
4
9
 
5
10
  - Non-optional fields no longer have default values
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.
@@ -2,7 +2,8 @@
2
2
  require 'mkmf'
3
3
 
4
4
  makefile_path = File.join('Makefile')
5
- client_version = '0.16.37'
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=#{client_version}
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
Binary file
@@ -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[request_id]
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)
@@ -1,3 +1,3 @@
1
1
  module TigerBeetle
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
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.2
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-05-04 00:00:00.000000000 Z
11
+ date: 2025-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi