murasaki 0.2.1.1 → 0.2.2

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
2
  SHA256:
3
- metadata.gz: 8a215230abbb509a890da12a276fa95ba32990d1f297cd73e177c765e5f346e3
4
- data.tar.gz: f983c291f51c8eee403c4174c03091a7c81441b73a5bc81ade080464925140bc
3
+ metadata.gz: b70d443790f1b8ff90bc9308cb7a985cdf373ca4b55c23ee5decf03b4c21fb39
4
+ data.tar.gz: bf48c8c011e137dc856f5a4d55bd19c629ce528747a35363e1f12aa0d8947e08
5
5
  SHA512:
6
- metadata.gz: 58cb8a6c1271fc8d388dea834aa36f1d2ce0e41193769875996b015aeee4efca8acb52052509d381f3991e2fdbb4d454d57c93cd3dfb38c922c21dab2cd01be0
7
- data.tar.gz: 3990b258aa7bb692ad62ec64ac867a2532824dab0ab8dd28e49389d28d68193845b6af800c7af24843330cdd91d13c0cd02b190b568a03cb71bd5ab30d7c751e
6
+ metadata.gz: c04b4df7d27f6e6a89dcc6f5ad14d5802dcc706a0a3959ede59313ba8f799b97eaebb676a43027022e4dddddd464a9f43711eda69d1d7e364af69440a555ef6d
7
+ data.tar.gz: 93d33d2e2fd3afb3b47df823e842400afb84667129b86bcc24c1b23e85dc608ecfd5bb9cffda663a23e795a31e72947e35c200064a15fe2c2e52289b1f2649eb
@@ -15,6 +15,8 @@ module EventLoop
15
15
  @queue = Hash.new
16
16
  # Root fiber
17
17
  @root_fiber = Fiber.current
18
+ # Thread for timer
19
+ @timer_thread = nil
18
20
  nil
19
21
  end
20
22
  end
@@ -95,7 +97,6 @@ module EventLoop
95
97
  @selector.select(0.2) do |monitor| # Timeout for 0.2 secs
96
98
  @ios[monitor.io][:callback].call(monitor)
97
99
  end
98
- timer_once
99
100
  nil
100
101
  end
101
102
 
@@ -118,6 +119,7 @@ module EventLoop
118
119
  def start
119
120
  return if running?
120
121
  @stop = false
122
+ @timer_thread = Thread.new { loop { sleep 0.5; timer_once }}
121
123
  until @stop
122
124
  run_once
123
125
  end
@@ -128,6 +130,7 @@ module EventLoop
128
130
  # @return [nil] nil
129
131
  def stop
130
132
  @stop = true
133
+ Thread.kill(@timer_thread)
131
134
  nil
132
135
  end
133
136
 
@@ -1,5 +1,5 @@
1
1
  # Murasaki Module
2
2
  module Murasaki
3
3
  # Current Version Code
4
- VERSION = '0.2.1.1'.freeze
4
+ VERSION = '0.2.2'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: murasaki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - HeckPsi Lab