Skip to content

Commit

Permalink
Merge pull request #812 from adamruzicka/fix-repo-layout
Browse files Browse the repository at this point in the history
Move edge bits from lib-edge to lib/concurrent-edge
  • Loading branch information
pitr-ch committed Jan 19, 2020
2 parents 8b8a8a3 + 4c34810 commit f749b81
Show file tree
Hide file tree
Showing 352 changed files with 3,223 additions and 3,540 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Expand Up @@ -28,6 +28,6 @@
/spec/examples.txt

# Compiled files
/lib/concurrent/concurrent_ruby.jar
/lib/concurrent/**/concurrent_ruby_ext.*
/lib/concurrent/concurrent_ruby_ext.*
/lib/concurrent-ruby/concurrent/concurrent_ruby.jar
/lib/concurrent-ruby/concurrent/**/concurrent_ruby_ext.*
/lib/concurrent-ruby/concurrent/concurrent_ruby_ext.*
4 changes: 2 additions & 2 deletions Gemfile
@@ -1,7 +1,7 @@
source 'https://rubygems.org'

require File.join(File.dirname(__FILE__), 'lib/concurrent/version')
require File.join(File.dirname(__FILE__ ), 'lib-edge/concurrent/edge/version')
require File.join(File.dirname(__FILE__), 'lib/concurrent-ruby/concurrent/version')
require File.join(File.dirname(__FILE__ ), 'lib/concurrent-ruby-edge/concurrent/edge/version')

no_path = ENV['NO_PATH']
options = no_path ? {} : { path: '.' }
Expand Down
18 changes: 9 additions & 9 deletions Rakefile
@@ -1,6 +1,6 @@
require_relative 'lib/concurrent/version'
require_relative 'lib-edge/concurrent/edge/version'
require_relative 'lib/concurrent/utility/engine'
require_relative 'lib/concurrent-ruby/concurrent/version'
require_relative 'lib/concurrent-ruby-edge/concurrent/edge/version'
require_relative 'lib/concurrent-ruby/concurrent/utility/engine'

if Concurrent.ruby_version :<, 2, 0, 0
# @!visibility private
Expand All @@ -19,15 +19,15 @@ require 'rake/javaextensiontask'

Rake::JavaExtensionTask.new('concurrent_ruby', core_gemspec) do |ext|
ext.ext_dir = 'ext/concurrent-ruby'
ext.lib_dir = 'lib/concurrent'
ext.lib_dir = 'lib/concurrent-ruby/concurrent'
end

unless Concurrent.on_jruby?
require 'rake/extensiontask'

Rake::ExtensionTask.new('concurrent_ruby_ext', ext_gemspec) do |ext|
ext.ext_dir = 'ext/concurrent-ruby-ext'
ext.lib_dir = 'lib/concurrent'
ext.lib_dir = 'lib/concurrent-ruby/concurrent'
ext.source_pattern = '*.{c,h}'

ext.cross_compile = true
Expand All @@ -44,7 +44,7 @@ namespace :repackage do
sh 'bundle package'

# build only the jar file not the whole gem for java platform, the jar is part the concurrent-ruby-x.y.z.gem
Rake::Task['lib/concurrent/concurrent_ruby.jar'].invoke
Rake::Task['lib/concurrent-ruby/concurrent/concurrent_ruby.jar'].invoke

# build all gem files
RakeCompilerDock.sh 'bundle install --local && bundle exec rake cross native package --trace'
Expand All @@ -59,7 +59,7 @@ Gem::PackageTask.new(core_gemspec) {} if core_gemspec
Gem::PackageTask.new(ext_gemspec) {} if ext_gemspec && !Concurrent.on_jruby?
Gem::PackageTask.new(edge_gemspec) {} if edge_gemspec

CLEAN.include('lib/concurrent/2.*', 'lib/concurrent/*.jar')
CLEAN.include('lib/concurrent-ruby/concurrent/2.*', 'lib/concurrent-ruby/concurrent/*.jar')

begin
require 'rspec'
Expand Down Expand Up @@ -164,8 +164,8 @@ begin
'--output-dir', output_dir,
'--main', 'tmp/README.md',
*common_yard_options)
yard.files = ['./lib/**/*.rb',
'./lib-edge/**/*.rb',
yard.files = ['./lib/concurrent-ruby/**/*.rb',
'./lib/concurrent-ruby-edge/**/*.rb',
'./ext/concurrent_ruby_ext/**/*.c',
'-',
'docs-source/thread_pools.md',
Expand Down
7 changes: 4 additions & 3 deletions concurrent-ruby-edge.gemspec
@@ -1,4 +1,5 @@
require File.join(File.dirname(__FILE__ ), 'lib-edge/concurrent/edge/version')
require File.join(File.dirname(__FILE__ ), 'lib/concurrent-ruby/concurrent/version')
require File.join(File.dirname(__FILE__ ), 'lib/concurrent-ruby-edge/concurrent/edge/version')

Gem::Specification.new do |s|
git_files = `git ls-files`.split("\n")
Expand All @@ -12,9 +13,9 @@ Gem::Specification.new do |s|
s.summary = 'Edge features and additions to the concurrent-ruby gem.'
s.license = 'MIT'
s.date = Time.now.strftime('%Y-%m-%d')
s.files = Dir['lib-edge/**/*.rb'] & git_files
s.files = Dir['lib/concurrent-ruby-edge/**/*.rb'] & git_files
s.extra_rdoc_files = Dir['README*', 'LICENSE*', 'CHANGELOG*']
s.require_paths = ['lib-edge']
s.require_paths = ['lib/concurrent-ruby-edge']
s.description = <<-TXT
These features are under active development and may change frequently. They are expected not to
keep backward compatibility (there may also lack tests and documentation). Semantic versions will
Expand Down
2 changes: 1 addition & 1 deletion concurrent-ruby-ext.gemspec
@@ -1,4 +1,4 @@
require File.join(File.dirname(__FILE__ ), 'lib/concurrent/version')
require File.join(File.dirname(__FILE__ ), 'lib/concurrent-ruby/concurrent/version')

Gem::Specification.new do |s|
s.name = 'concurrent-ruby-ext'
Expand Down
13 changes: 7 additions & 6 deletions concurrent-ruby.gemspec
@@ -1,5 +1,5 @@
require File.join(File.dirname(__FILE__ ), 'lib/concurrent/version')
require File.join(File.dirname(__FILE__ ), 'lib/concurrent/utility/engine')
require File.join(File.dirname(__FILE__ ), 'lib/concurrent-ruby/concurrent/version')
require File.join(File.dirname(__FILE__ ), 'lib/concurrent-ruby/concurrent/utility/engine')

Gem::Specification.new do |s|
git_files = `git ls-files`.split("\n")
Expand All @@ -13,13 +13,14 @@ Gem::Specification.new do |s|
s.summary = 'Modern concurrency tools for Ruby. Inspired by Erlang, Clojure, Scala, Haskell, F#, C#, Java, and classic concurrency patterns.'
s.license = 'MIT'
s.date = Time.now.strftime('%Y-%m-%d')
s.files = [*Dir['lib/**/*.rb'] & git_files,
s.files = [*Dir['lib/concurrent-ruby/**/*.rb'] & git_files,
*Dir['ext/concurrent-ruby/**/*'] & git_files,
'Rakefile', 'Gemfile',
'lib/concurrent/concurrent_ruby.jar'
'Rakefile',
'Gemfile',
'lib/concurrent-ruby/concurrent/concurrent_ruby.jar'
]
s.extra_rdoc_files = Dir['README*', 'LICENSE*', 'CHANGELOG*']
s.require_paths = ['lib']
s.require_paths = ['lib/concurrent-ruby']
s.description = <<-TXT.gsub(/^ +/, '')
Modern concurrency tools including agents, futures, promises, thread pools, actors, supervisors, and more.
Inspired by Erlang, Clojure, Go, JavaScript, actors, and classic concurrency patterns.
Expand Down
28 changes: 14 additions & 14 deletions docs-source/channel.out.md
Expand Up @@ -204,17 +204,17 @@ log
# "producer 0 pushing 2",
# "producer 1 pushing 0",
# "consumer 0 got 0. payload 0 from producer 0",
# "producer 0 pushing 3",
# "consumer 1 got 0. payload 1 from producer 0",
# "producer 1 pushing 1",
# "consumer 2 got 0. payload 2 from producer 0",
# "consumer 3 got 0. payload 0 from producer 1",
# "producer 0 pushing 3",
# "producer 1 pushing 1",
# "producer 1 pushing 2",
# "consumer 0 got 1. payload 3 from producer 0",
# "consumer 1 got 1. payload 3 from producer 0",
# "producer 1 pushing 3",
# "consumer 3 got 1. payload 1 from producer 1",
# "consumer 1 got 1. payload 2 from producer 1",
# "consumer 2 got 1. payload 3 from producer 1"]
# "consumer 0 got 1. payload 1 from producer 1",
# "consumer 2 got 1. payload 2 from producer 1",
# "consumer 3 got 1. payload 3 from producer 1"]
```

The producers are much faster than consumers
Expand Down Expand Up @@ -268,20 +268,20 @@ consumers.map(&:value!) # => [:done, :done, :done, :done]
# investigate log
log
# => ["producer 0 pushing 0",
# "producer 0 pushing 1",
# "producer 1 pushing 0",
# "consumer 1 got 0. payload 1 from producer 0",
# "producer 0 pushing 2",
# "producer 0 pushing 3",
# "producer 0 pushing 1",
# "producer 1 pushing 1",
# "consumer 0 got 0. payload 0 from producer 0",
# "consumer 2 got 0. payload 0 from producer 1",
# "consumer 1 got 0. payload 0 from producer 1",
# "consumer 2 got 0. payload 1 from producer 0",
# "producer 0 pushing 2",
# "consumer 3 got 0. payload 1 from producer 1",
# "producer 1 pushing 2",
# "consumer 3 got 0. payload 2 from producer 0",
# "producer 0 pushing 3",
# "producer 1 pushing 3",
# "consumer 1 got 1. payload 3 from producer 0",
# "consumer 0 got 1. payload 1 from producer 1",
# "consumer 1 got 1. payload 2 from producer 0",
# "consumer 2 got 1. payload 2 from producer 1",
# "consumer 0 got 1. payload 3 from producer 0",
# "consumer 3 got 1. payload 3 from producer 1"]
```

Expand Down

0 comments on commit f749b81

Please sign in to comment.