fiber-scheduler 0.12.0 → 0.13.0

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: d6a375b6e9a2d17be96e9c118ac624bbcbea154f961a205a9e1b0fc560b96f5e
4
- data.tar.gz: 54e447b2977cfeb14bb06db5286eb3b291e2645dd9f0cc92f5aca2f5a8081372
3
+ metadata.gz: 900e46580ebb4fd13f4806ca78d4973d6a3a7794e3ab4b9587d86b271aa704c0
4
+ data.tar.gz: ac545db55582476b58171ad33e43fa8049c11aa8ced996612797162b2ef44140
5
5
  SHA512:
6
- metadata.gz: c5f13b97d884ae06d98cdd2cea421ea8df2294e04a4ba4bc5a508df36a35f089eafd83741b7d57a105169ba93efdb512f65590c0624b225f527a046fefd23042
7
- data.tar.gz: e055549f62f5ffabf6470a6d2ec3069f3d4df7bfd02bcf43f4f6a82e094927fa09ff6604186182e5d4123a6893f04b7fe6fb2ebd3b14e8da2d06468f53d6c3ee
6
+ metadata.gz: f28ff450320b55a2eb76a8cde225d787b7c524c2e42abad441d135764557450688606bdf03a7bea97d993b1a34e0d1fcb6e46662a5984bd26efa938f43596ed6
7
+ data.tar.gz: 33198428d0485ef90e9fd5d5017df63e7fb30957699d1c1cac06281baa88b4440a1568966b1e8dd82aa0a5736785989996c9ff4d97a084423d788dcbd1953102
@@ -35,8 +35,8 @@ class FiberScheduler
35
35
 
36
36
  fiber
37
37
 
38
- when :fleeting
39
- # Transfer to current fiber some time after a fleeting fiber yields.
38
+ when :volatile
39
+ # Transfer to current fiber some time after a volatile fiber yields.
40
40
  unblock(nil, Fiber.current)
41
41
  # Alternative to #unblock: Fiber.scheduler.push(Fiber.current)
42
42
 
@@ -46,9 +46,9 @@ class FiberScheduler
46
46
  rescue Close
47
47
  # Fiber scheduler is closing.
48
48
  ensure
49
- _fleeting.delete(Fiber.current)
49
+ _volatile.delete(Fiber.current)
50
50
  end
51
- _fleeting[fiber] = nil
51
+ _volatile[fiber] = nil
52
52
  fiber.tap(&:transfer)
53
53
 
54
54
  when nil
@@ -63,17 +63,17 @@ class FiberScheduler
63
63
  end
64
64
  end
65
65
 
66
- # #close and #_fleeting handle a complexity in Async::Scheduler#close, more
66
+ # #close and #_volatile handle a complexity in Async::Scheduler#close, more
67
67
  # specifically this line:
68
68
  # https://github.com/socketry/async/blob/456df488d801572821eaf5ec2fda10e3b9744a5f/lib/async/scheduler.rb#L55
69
69
  def close
70
70
  super
71
71
  rescue
72
- if _fleeting.empty?
72
+ if _volatile.empty?
73
73
  Kernel.raise
74
74
  else
75
- # #dup is used because #_fleeting is modified during iteration.
76
- _fleeting.dup.each do |fiber, _|
75
+ # #dup is used because #_volatile is modified during iteration.
76
+ _volatile.dup.each do |fiber, _|
77
77
  fiber.raise(Close)
78
78
  end
79
79
 
@@ -81,8 +81,8 @@ class FiberScheduler
81
81
  end
82
82
  end
83
83
 
84
- def _fleeting
85
- @_fleeting ||= {}
84
+ def _volatile
85
+ @_volatile ||= {}
86
86
  end
87
87
 
88
88
  def self.set_internal!
@@ -1,3 +1,3 @@
1
1
  class FiberScheduler
2
- VERSION = "0.12.0".freeze
2
+ VERSION = "0.13.0".freeze
3
3
  end
@@ -68,7 +68,7 @@ module Kernel
68
68
 
69
69
  fiber
70
70
 
71
- when :fleeting
71
+ when :volatile
72
72
  scheduler.unblock(nil, Fiber.current)
73
73
 
74
74
  fiber = Fiber.new(blocking: false) do
@@ -77,9 +77,9 @@ module Kernel
77
77
  rescue FiberScheduler::Compatibility::Close
78
78
  # Fiber scheduler is closing.
79
79
  ensure
80
- scheduler._fleeting.delete(Fiber.current)
80
+ scheduler._volatile.delete(Fiber.current)
81
81
  end
82
- scheduler._fleeting[fiber] = nil
82
+ scheduler._volatile[fiber] = nil
83
83
  fiber.tap(&:transfer)
84
84
 
85
85
  when nil
@@ -221,7 +221,7 @@ class FiberScheduler
221
221
 
222
222
  fiber
223
223
 
224
- when :fleeting
224
+ when :volatile
225
225
  if current != @fiber
226
226
  # nested Fiber.schedule
227
227
  @nested << current
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fiber-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno Sutic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-16 00:00:00.000000000 Z
11
+ date: 2022-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async