async-container 0.16.0 → 0.16.1

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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/Rakefile +2 -0
  4. data/examples/async.rb +1 -0
  5. data/examples/channel.rb +1 -0
  6. data/examples/channels/client.rb +1 -0
  7. data/examples/container.rb +1 -0
  8. data/examples/isolate.rb +1 -0
  9. data/examples/minimal.rb +1 -0
  10. data/examples/test.rb +1 -0
  11. data/examples/threads.rb +1 -0
  12. data/examples/title.rb +1 -0
  13. data/examples/udppipe.rb +1 -0
  14. data/lib/async/container.rb +2 -0
  15. data/lib/async/container/best.rb +2 -0
  16. data/lib/async/container/channel.rb +2 -0
  17. data/lib/async/container/controller.rb +2 -0
  18. data/lib/async/container/error.rb +2 -0
  19. data/lib/async/container/forked.rb +2 -0
  20. data/lib/async/container/generic.rb +2 -0
  21. data/lib/async/container/group.rb +2 -0
  22. data/lib/async/container/hybrid.rb +2 -0
  23. data/lib/async/container/keyed.rb +2 -0
  24. data/lib/async/container/notify.rb +1 -0
  25. data/lib/async/container/notify/client.rb +1 -0
  26. data/lib/async/container/notify/pipe.rb +3 -2
  27. data/lib/async/container/notify/server.rb +1 -0
  28. data/lib/async/container/notify/socket.rb +1 -0
  29. data/lib/async/container/process.rb +2 -0
  30. data/lib/async/container/statistics.rb +2 -0
  31. data/lib/async/container/thread.rb +2 -0
  32. data/lib/async/container/threaded.rb +2 -0
  33. data/lib/async/container/version.rb +3 -1
  34. data/spec/async/container/controller_spec.rb +5 -3
  35. data/spec/async/container/forked_spec.rb +2 -0
  36. data/spec/async/container/hybrid_spec.rb +2 -0
  37. data/spec/async/container/notify/notify.rb +1 -0
  38. data/spec/async/container/notify/pipe_spec.rb +2 -0
  39. data/spec/async/container/notify_spec.rb +2 -0
  40. data/spec/async/container/shared_examples.rb +2 -0
  41. data/spec/async/container/threaded_spec.rb +2 -0
  42. data/spec/async/container_spec.rb +2 -0
  43. data/spec/spec_helper.rb +1 -0
  44. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd0aec5639eb9f64edc338624657d7e6442948b5e4f403acac9264707a5d2bfe
4
- data.tar.gz: 3ef49efb43cb2cf4c4470ce9ed98426d18d41e009e19f11c5f10a718a30b80c2
3
+ metadata.gz: efe790ddbf87b5df04f8b9e441b27fda5fb1cb69cc6fa2b800a64d3f6af46f24
4
+ data.tar.gz: 6500f4e2b6d21d8f78a6f99065c0af795694f003c15f1f265634be36a4c8f229
5
5
  SHA512:
6
- metadata.gz: c4a15262693a7928b00ecf157f57d2333e9760387e7d723ce9679732d21eeb566b855835e593db486e912976e8cdf69ce1a67b4c5a1d9f3c54614de2df39b9d2
7
- data.tar.gz: e2d4e51a734a853852cf3aae1119a8a01698b62e6be5791612c6e008f67518cf651b39be3b959d45f4ca42830fa2b7e7f2fb2bfb8be8b82696bfaaa6009d39e1
6
+ metadata.gz: d27b92c0e9333dd121f5f5d65be1249073d1e06e55d018f3d91c0670feb14b8463629783c0fe74c416e8f6df1d08f1c84270a5bc19ec040c68c6778da8bdf02d
7
+ data.tar.gz: ddb9d010c191f469347a759ff2c90fd8d1cab8fddcb0ab6245357098bb1d576843fd351c767ea1dd9d8302dabe549fef04444e090960e0c9ee3d173ff5cbeed4
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in utopia.gemspec
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "rspec/core/rake_task"
3
5
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  require 'kernel/sync'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  require 'json'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  require 'msgpack'
3
4
  require 'async/io'
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require '../lib/async/container/controller'
4
5
  require '../lib/async/container/forked'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  # We define end of life-cycle in terms of "Interrupt" (SIGINT), "Terminate" (SIGTERM) and "Kill" (SIGKILL, does not invoke user code).
3
4
  class Terminate < Interrupt
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  class Threaded
3
4
  def initialize(&block)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  require_relative 'group'
3
4
  require_relative 'thread'
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  puts "Process pid: #{Process.pid}"
4
5
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  Process.setproctitle "Preparing for sleep..."
4
5
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'async/io'
4
5
  require 'async/io/endpoint'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
5
  #
@@ -81,10 +82,10 @@ module Async
81
82
  send(ready: true, **message)
82
83
  end
83
84
 
84
- def reloading!(**message)
85
+ def restarting!(**message)
85
86
  message[:ready] = false
86
87
  message[:reloading] = true
87
- message[:status] ||= "Reloading..."
88
+ message[:status] ||= "Restarting..."
88
89
 
89
90
  send(**message)
90
91
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  #
3
4
  # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -20,6 +22,6 @@
20
22
 
21
23
  module Async
22
24
  module Container
23
- VERSION = "0.16.0"
25
+ VERSION = "0.16.1"
24
26
  end
25
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -31,18 +33,18 @@ RSpec.describe Async::Container::Controller do
31
33
  container.spawn(key: "test") do |instance|
32
34
  instance.ready!
33
35
 
34
- sleep(0.1)
36
+ sleep(0.2)
35
37
 
36
38
  @output.write(".")
37
39
  @output.flush
38
40
 
39
- sleep(0.2)
41
+ sleep(0.4)
40
42
  end
41
43
 
42
44
  container.spawn do |instance|
43
45
  instance.ready!
44
46
 
45
- sleep(0.2)
47
+ sleep(0.3)
46
48
 
47
49
  @output.write(",")
48
50
  @output.flush
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require_relative '../../../../lib/async/container'
4
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  require 'covered/rspec'
3
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-container
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-30 00:00:00.000000000 Z
11
+ date: 2020-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: process-group