sysvmq 0.2.2 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: dca403d32733e9e161c9e1f5a3fa31d2b5fce1c5
4
- data.tar.gz: f2aa09248715a7e67f3276114fdaf1bd4ed3d10e
2
+ SHA256:
3
+ metadata.gz: 8f91158a80f378e0c8a5797c260d364d798ec971428a7792f81db6a14f9d2229
4
+ data.tar.gz: 92c86e3bce74d7579113eb2c07a4ec848b01c8818681dacae4e727f9e945984a
5
5
  SHA512:
6
- metadata.gz: 8b885eb6c8d5a988190542a421cc97df868d335dd90e36ebe1c377985c8c76024286d6d39f820d9620376d39a2a6f19b52cfd388f61ae4edcca324c751a2ac7d
7
- data.tar.gz: e3e501ce8b8a98266c7f0bfa2c90f388f5e78dce1468e3dadf595d8fbe9336dd8dae4f8220b26be39e4f9c811eb536179190250a38ea400cab3c97db267fb40d
6
+ metadata.gz: 22a34a50fdb0141c8959ecd88d2c01453b39eb903e77285a8fbd3ba67273be65a7b7a87fccf1dd5c7c3c6815c837a06596bdaf51e5f185cd5d25acb63c0fc95d
7
+ data.tar.gz: f77a8586fc7620e7e1c59836e8d38ae2e11819c6fc2f88ec2c91ddd57ee08a606f2d47ce4d3aef441a9a91ca6a73a88546eab5d8b4935fb08b49a86c6b3dad49
@@ -0,0 +1,19 @@
1
+ name: CI
2
+ on: [push]
3
+
4
+ jobs:
5
+ tests:
6
+ runs-on: ubuntu-latest
7
+ strategy:
8
+ matrix:
9
+ ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1', '3.2' ]
10
+ name: Ruby ${{ matrix.ruby }} Tests
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+ - name: Set up Ruby
14
+ uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: ${{ matrix.ruby }}
17
+ bundler-cache: true
18
+ - name: Run tests
19
+ run: bundle exec rake
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  *.gem
2
2
  *.rbc
3
- .bundle
3
+ *.bundle
4
+ *.so
4
5
  .config
5
6
  .yardoc
6
7
  Gemfile.lock
data/Gemfile CHANGED
@@ -1,4 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in sysv-mq.gemspec
4
+
5
+ gem "rake"
6
+ gem "rake-compiler"
7
+ gem "minitest"
8
+
4
9
  gemspec
data/README.md CHANGED
@@ -13,7 +13,7 @@ Note that `sysvmq` doesn't rely on any third-party message broker. The message
13
13
  queue is handled by the kernel. It's extremely stable and performant.
14
14
 
15
15
  `sysvmq` has been tested heavily in production at Shopify, under more than `100k
16
- RPM`.
16
+ RPS` and is still in use as of Feb, 2020.
17
17
 
18
18
  ## Installation
19
19
 
data/ext/extconf.rb CHANGED
@@ -4,7 +4,4 @@ have_header 'sys/ipc.h'
4
4
  have_header 'sys/msg.h'
5
5
  have_header 'sys/types.h'
6
6
 
7
- have_func 'rb_thread_blocking_region'
8
- have_func 'rb_thread_call_without_gvl'
9
-
10
7
  create_makefile 'sysvmq'
data/ext/sysvmq.c CHANGED
@@ -14,20 +14,10 @@
14
14
 
15
15
  #define UNINITIALIZED_ERROR -2
16
16
 
17
- #if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL) && defined(HAVE_RUBY_THREAD_H)
18
- // 2.0
19
17
  #include <ruby/thread.h>
20
18
  #define WITHOUT_GVL(fn,a,ubf,b) \
21
19
  rb_thread_call_without_gvl((fn),(a),(ubf),(b))
22
20
 
23
- #elif defined(HAVE_RB_THREAD_BLOCKING_REGION)
24
- // 1.9
25
- typedef VALUE (*my_blocking_fn_t)(void*);
26
- #define WITHOUT_GVL(fn,a,ubf,b) \
27
- rb_thread_blocking_region((my_blocking_fn_t)(fn),(a),(ubf),(b))
28
-
29
- #endif
30
-
31
21
  // This is the buffer passed to msg{rcv,snd,ctl}(2)
32
22
  typedef struct {
33
23
  long mtype;
@@ -47,12 +37,6 @@ typedef struct {
47
37
  }
48
38
  sysvmq_t;
49
39
 
50
- static void
51
- sysvmq_mark(void *ptr)
52
- {
53
- // noop, no Ruby objects in the internal struct currently
54
- }
55
-
56
40
  static void
57
41
  sysvmq_free(void *ptr)
58
42
  {
@@ -70,12 +54,13 @@ sysvmq_memsize(const void* ptr)
70
54
 
71
55
  static const rb_data_type_t
72
56
  sysvmq_type = {
73
- "sysvmq_type",
74
- {
75
- sysvmq_mark,
76
- sysvmq_free,
77
- sysvmq_memsize
78
- }
57
+ .wrap_struct_name = "sysvmq_type",
58
+ .function = {
59
+ .dmark = NULL, // no Ruby objects in the internal struct currently
60
+ .dfree = sysvmq_free,
61
+ .dsize = sysvmq_memsize,
62
+ },
63
+ .flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
79
64
  };
80
65
 
81
66
  static VALUE
@@ -226,7 +211,7 @@ sysvmq_receive(int argc, VALUE *argv, VALUE self)
226
211
  continue;
227
212
  }
228
213
 
229
- rb_sys_fail("Failed recieving message from queue");
214
+ rb_sys_fail("Failed receiving message from queue");
230
215
  }
231
216
  } else {
232
217
  // msgrcv(2) can block sending a message, if IPC_NOWAIT is not passed.
@@ -374,7 +359,7 @@ sysvmq_initialize(VALUE self, VALUE key, VALUE buffer_size, VALUE flags)
374
359
  // for each message sent. This makes SysVMQ not thread-safe (requiring a
375
360
  // buffer for each thread), but is a reasonable trade-off for now for the
376
361
  // performance.
377
- sysv->buffer_size = (size_t) FIX2LONG(buffer_size + 1);
362
+ sysv->buffer_size = (size_t) FIX2LONG(buffer_size) + 1;
378
363
  msgbuf_size = sysv->buffer_size * sizeof(char) + sizeof(long);
379
364
 
380
365
  // Note that this is a zero-length array, so we size the struct to size of the
data/sysvmq.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "sysvmq"
7
- spec.version = '0.2.2'
7
+ spec.version = '0.2.4'
8
8
  spec.authors = ["Simon Eskildsen"]
9
9
  spec.email = ["sirup@sirupsen.com"]
10
10
  spec.summary = %q{Ruby wrapper for SysV Message Queues}
@@ -12,13 +12,11 @@ Gem::Specification.new do |spec|
12
12
  spec.homepage = "https://github.com/Sirupsen/sysvmq"
13
13
  spec.license = "MIT"
14
14
 
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
16
+
15
17
  spec.files = `git ls-files`.split($/)
16
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
20
  spec.require_paths = ["lib"]
19
21
  spec.extensions = ["ext/extconf.rb"]
20
-
21
- spec.add_development_dependency "bundler"
22
- spec.add_development_dependency "rake"
23
- spec.add_development_dependency "rake-compiler", "~> 0.9"
24
22
  end
data/test/sysv_mq_test.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  #coding: utf-8
2
2
  require_relative 'test_helper'
3
3
 
4
- class SysVMQTest < MiniTest::Unit::TestCase
4
+ class SysVMQTest < MiniTest::Test
5
5
  def setup
6
6
  @size = 1024
7
7
  @mq = SysVMQ.new(0xDEADC0DE, @size, SysVMQ::IPC_CREAT | 0666)
data/test/test_helper.rb CHANGED
@@ -1,3 +1,2 @@
1
- require 'minitest/unit'
2
1
  require 'minitest/autorun'
3
2
  require 'sysvmq'
metadata CHANGED
@@ -1,57 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sysvmq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Eskildsen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-06 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rake-compiler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0.9'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '0.9'
11
+ date: 2024-11-07 00:00:00.000000000 Z
12
+ dependencies: []
55
13
  description: Ruby wrapper for SysV Message Queues
56
14
  email:
57
15
  - sirup@sirupsen.com
@@ -60,8 +18,8 @@ extensions:
60
18
  - ext/extconf.rb
61
19
  extra_rdoc_files: []
62
20
  files:
21
+ - ".github/workflows/tests.yml"
63
22
  - ".gitignore"
64
- - ".travis.yml"
65
23
  - Gemfile
66
24
  - LICENSE.txt
67
25
  - README.md
@@ -78,7 +36,7 @@ homepage: https://github.com/Sirupsen/sysvmq
78
36
  licenses:
79
37
  - MIT
80
38
  metadata: {}
81
- post_install_message:
39
+ post_install_message:
82
40
  rdoc_options: []
83
41
  require_paths:
84
42
  - lib
@@ -86,16 +44,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
44
  requirements:
87
45
  - - ">="
88
46
  - !ruby/object:Gem::Version
89
- version: '0'
47
+ version: 2.5.0
90
48
  required_rubygems_version: !ruby/object:Gem::Requirement
91
49
  requirements:
92
50
  - - ">="
93
51
  - !ruby/object:Gem::Version
94
52
  version: '0'
95
53
  requirements: []
96
- rubyforge_project:
97
- rubygems_version: 2.2.2
98
- signing_key:
54
+ rubygems_version: 3.5.11
55
+ signing_key:
99
56
  specification_version: 4
100
57
  summary: Ruby wrapper for SysV Message Queues
101
58
  test_files:
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - 2.1.0