• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-concurrency / concurrent-ruby / #2764

08 Dec 2014 03:40PM UTC coverage: 91.388% (-0.4%) from 91.753%
#2764

push

jdantonio
Merge pull request #201 from rkday/fallback_handling

Posting to a shutdown thread pool - JRuby consistency and better naming

18 of 26 new or added lines in 5 files covered. (69.23%)

212 existing lines in 36 files now uncovered.

2812 of 3077 relevant lines covered (91.39%)

369.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.61
/lib/concurrent/actor/behaviour/linking.rb
1
module Concurrent
1✔
2
  module Actor
1✔
3
    module Behaviour
1✔
4

5
      # Links the actor to other actors and sends actor's events to them,
6
      # like: `:terminated`, `:paused`, errors, etc
7
      # TODO example
8
      class Linking < Abstract
1✔
9
        def initialize(core, subsequent)
1✔
10
          super core, subsequent
255✔
11
          @linked = Set.new
255✔
12
        end
13

14
        def on_envelope(envelope)
1✔
15
          case envelope.message
711✔
16
          when :link
17
            link envelope.sender
2✔
18
          when :unlink
19
            unlink envelope.sender
×
20
          when :linked?
UNCOV
21
            @linked.include? envelope.sender
×
22
          else
23
            pass envelope
709✔
24
          end
25
        end
26

27
        def link(ref)
1✔
28
          @linked.add(ref)
12✔
29
          true
12✔
30
        end
31

32
        def unlink(ref)
1✔
UNCOV
33
          @linked.delete(ref)
×
UNCOV
34
          true
×
35
        end
36

37
        def on_event(event)
1✔
38
          @linked.each { |a| a << event }
274✔
39
          @linked.clear if event == :terminated
257✔
40
          super event
257✔
41
        end
42
      end
43
    end
44
  end
45
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc