Skip to content

Commit 3d6bdec

Browse files
committed
Merge pull request #481 from ruby-concurrency/fix-autoload-bug-on-jruby
Resolved NameError on JRuby by using fewer autoloads.
2 parents d40875c + c5a73ab commit 3d6bdec

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ rvm:
99
- 1.9.3
1010
- ruby-head
1111
- jruby-1.7.19
12+
- jruby-9.0.1.0
1213
- jruby-9.0.3.0
1314
- jruby-9.0.4.0
1415
- jruby-head

lib/concurrent/delay.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
module Concurrent
77

8+
# This file has circular require issues. It must be autoloaded here.
89
autoload :Options, 'concurrent/options'
910

1011
# Lazy evaluation of a block yielding an immutable result. Useful for

lib/concurrent/executor/timer_set.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
require 'concurrent/executor/executor_service'
55
require 'concurrent/executor/single_thread_executor'
66

7-
module Concurrent
7+
require 'concurrent/options'
88

9-
autoload :Options, 'concurrent/options'
9+
module Concurrent
1010

1111
# Executes a collection of tasks, each after a given delay. A master task
1212
# monitors the set and schedules each task for execution at the appropriate
@@ -21,7 +21,7 @@ class TimerSet < RubyExecutorService
2121
# Create a new set of timed tasks.
2222
#
2323
# @!macro [attach] executor_options
24-
#
24+
#
2525
# @param [Hash] opts the options used to specify the executor on which to perform actions
2626
# @option opts [Executor] :executor when set use the given `Executor` instance.
2727
# Three special values are also supported: `:task` returns the global task pool,

lib/concurrent/future.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
require 'concurrent/ivar'
55
require 'concurrent/executor/safe_task_executor'
66

7-
module Concurrent
7+
require 'concurrent/options'
88

9-
autoload :Options, 'concurrent/options'
9+
module Concurrent
1010

1111
# {include:file:doc/future.md}
1212
#

lib/concurrent/options.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# This file has circular require issues. It must be autoloaded.
2-
31
require 'concurrent/configuration'
42

53
module Concurrent

lib/concurrent/promise.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
require 'concurrent/errors'
44
require 'concurrent/ivar'
55

6-
module Concurrent
6+
require 'concurrent/options'
77

8-
autoload :Options, 'concurrent/options'
8+
module Concurrent
99

1010
PromiseExecutionError = Class.new(StandardError)
1111

lib/concurrent/scheduled_task.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
require 'concurrent/collection/copy_on_notify_observer_set'
66
require 'concurrent/utility/monotonic_time'
77

8-
module Concurrent
8+
require 'concurrent/options'
99

10-
autoload :Options, 'concurrent/options'
10+
module Concurrent
1111

1212
# `ScheduledTask` is a close relative of `Concurrent::Future` but with one
1313
# important difference: A `Future` is set to execute as soon as possible

0 commit comments

Comments
 (0)