hoopagent 1.14.9.pre.beta1 → 1.14.9.pre.beta3

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: 87e49cdecf7e05081df17fde1dd0bcacdd3eec94d8781acdd059ca357e357cbf
4
- data.tar.gz: 74096c3d2d3c2dce99658b75e6218e3c09658f743598bf6efeb270289bf71826
3
+ metadata.gz: 14efc22159693a778ee596cc1f599fb13908f1b5c615cc7b8e8a75f09fe61d71
4
+ data.tar.gz: 732bae28d5983db032449933afa8947a3d2dd22b442535871b953d24f415d1a4
5
5
  SHA512:
6
- metadata.gz: 9a5c68c01c31babb997665ac09dcd4c4388b060a8a76d8cf13a342b267be23fa3acca90a3e1de861b77c024be88ca92e97136e8e382b981ce83a6c651b3af5cd
7
- data.tar.gz: 21d4d410b4c26f5594b46cb8f5a4d1a2331c6051dcc9c544ba86bb85d266fe4f378675c111341b3184bc60886b232203b43b12d3686baf9a0a5d60636ff97e10
6
+ metadata.gz: 0bf0f8049f863cf2f0a3b341cb88fcaefddcf064ea9e7c40ce8b98d9c1d2b086787e9762cf10fcf9136c71b8dca44e0fcdc576f72ae59cd36e8ac151cd2cc8fe
7
+ data.tar.gz: a01de4016c72a700be7b9b63c4e7d2aeaf03ea0000a0a9e58231c6f25c86f164af79659e0e6bdc62ff030c826d4dd40d5e6501f789b8dba9a29d7d0ed8efada2
@@ -74,8 +74,8 @@ typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
74
74
  extern "C" {
75
75
  #endif
76
76
 
77
- extern void __start_in_background();
78
- extern void __start();
77
+ extern void __start_in_background(GoString dsn);
78
+ extern void __start(GoString dsn);
79
79
 
80
80
  #ifdef __cplusplus
81
81
  }
Binary file
@@ -74,8 +74,8 @@ typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
74
74
  extern "C" {
75
75
  #endif
76
76
 
77
- extern void __start_in_background();
78
- extern void __start();
77
+ extern void __start_in_background(GoString dsn);
78
+ extern void __start(GoString dsn);
79
79
 
80
80
  #ifdef __cplusplus
81
81
  }
Binary file
data/lib/hoopagent.rb CHANGED
@@ -11,26 +11,38 @@ module HoopAgent
11
11
 
12
12
  if File.exist?(@lib_path)
13
13
  ffi_lib @lib_path
14
- attach_function :__start, [], :void
15
- attach_function :__start_in_background, [], :void
14
+
15
+ class GoString < FFI::Struct
16
+ layout :p, :pointer,
17
+ :len, :long_long
18
+ end
19
+
20
+ attach_function :__start, [GoString.by_value], :void
21
+ attach_function :__start_in_background, [GoString.by_value], :void
16
22
  else
17
23
  puts "[hoopagent] platform not supported: #{@platform}, lib_so=#{@lib_path}"
18
24
  end
19
25
 
20
- def self.start_in_background
21
- # avoid to block the main thread
26
+ def self.start_in_background(dsn)
22
27
  if File.exist?(@lib_path)
23
28
  Thread.new do
24
- self.__start_in_background()
29
+ dsn = dsn.to_s
30
+ gostr = HoopAgent::GoString.new
31
+ gostr[:p] = FFI::MemoryPointer.from_string(dsn)
32
+ gostr[:len] = dsn.size
33
+ self.__start_in_background(gostr)
25
34
  end
26
35
  end
27
36
  end
28
37
 
29
- def self.start
30
- # avoid to block the main thread
38
+ def self.start(dsn)
31
39
  if File.exist?(@lib_path)
32
- self.__start()
40
+ dsn = dsn.to_s
41
+ gostr = HoopAgent::GoString.new
42
+ gostr[:p] = FFI::MemoryPointer.from_string(dsn)
43
+ gostr[:len] = dsn.size
44
+ self.__start(gostr)
33
45
  end
34
46
  end
35
47
 
36
- end
48
+ end
@@ -74,8 +74,8 @@ typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
74
74
  extern "C" {
75
75
  #endif
76
76
 
77
- extern void __start_in_background();
78
- extern void __start();
77
+ extern void __start_in_background(GoString dsn);
78
+ extern void __start(GoString dsn);
79
79
 
80
80
  #ifdef __cplusplus
81
81
  }
Binary file
@@ -74,8 +74,8 @@ typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
74
74
  extern "C" {
75
75
  #endif
76
76
 
77
- extern void __start_in_background();
78
- extern void __start();
77
+ extern void __start_in_background(GoString dsn);
78
+ extern void __start(GoString dsn);
79
79
 
80
80
  #ifdef __cplusplus
81
81
  }
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoopagent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.9.pre.beta1
4
+ version: 1.14.9.pre.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Mello