Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/concurrent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@
require 'concurrent/errors'
require 'concurrent/executors'
require 'concurrent/utilities'
require 'concurrent/struct'

require 'concurrent/atomic/atomic_reference'
require 'concurrent/atom'
require 'concurrent/async'
require 'concurrent/dataflow'
require 'concurrent/delay'
require 'concurrent/future'
require 'concurrent/immutable_struct'
require 'concurrent/ivar'
require 'concurrent/maybe'
require 'concurrent/mutable_struct'
require 'concurrent/mvar'
require 'concurrent/promise'
require 'concurrent/scheduled_task'
require 'concurrent/settable_struct'
require 'concurrent/timer_task'
require 'concurrent/tvar'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'concurrent/struct/abstract_struct'
require 'concurrent/synchronization/abstract_struct'
require 'concurrent/synchronization'

module Concurrent
Expand All @@ -7,7 +7,7 @@ module Concurrent
#
# @see http://ruby-doc.org/core-2.2.0/Struct.html Ruby standard library `Struct`
module ImmutableStruct
include AbstractStruct
include Synchronization::AbstractStruct

# @!macro struct_values
def values
Expand Down Expand Up @@ -80,7 +80,7 @@ def self.new(*args, &block)
FACTORY = Class.new(Synchronization::Object) do
def define_struct(name, members, &block)
synchronize do
AbstractStruct.define_struct_class(ImmutableStruct, Synchronization::Object, name, members, &block)
Synchronization::AbstractStruct.define_struct_class(ImmutableStruct, Synchronization::Object, name, members, &block)
end
end
end.new
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'concurrent/struct/abstract_struct'
require 'concurrent/synchronization/abstract_struct'
require 'concurrent/synchronization'

module Concurrent
Expand All @@ -8,7 +8,7 @@ module Concurrent
#
# @see http://ruby-doc.org/core-2.2.0/Struct.html Ruby standard library `Struct`
module MutableStruct
include AbstractStruct
include Synchronization::AbstractStruct

# @!macro [new] struct_new
#
Expand Down Expand Up @@ -88,7 +88,7 @@ def inspect
# @yieldparam [Object] selfvalue the value of the member in `self`
# @yieldparam [Object] othervalue the value of the member in `other`
#
# @return [AbstractStruct] a new struct with the new values
# @return [Synchronization::AbstractStruct] a new struct with the new values
#
# @raise [ArgumentError] of given a member that is not defined in the struct
def merge(other, &block)
Expand Down Expand Up @@ -209,7 +209,7 @@ def self.new(*args, &block)
FACTORY = Class.new(Synchronization::Object) do
def define_struct(name, members, &block)
synchronize do
clazz = AbstractStruct.define_struct_class(MutableStruct, Synchronization::Object, name, members, &block)
clazz = Synchronization::AbstractStruct.define_struct_class(MutableStruct, Synchronization::Object, name, members, &block)
members.each_with_index do |member, index|
clazz.send(:define_method, member) do
synchronize { @values[index] }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'concurrent/struct/abstract_struct'
require 'concurrent/synchronization/abstract_struct'
require 'concurrent/errors'
require 'concurrent/synchronization'

Expand All @@ -12,7 +12,7 @@ module Concurrent
# @see http://ruby-doc.org/core-2.2.0/Struct.html Ruby standard library `Struct`
# @see http://en.wikipedia.org/wiki/Final_(Java) Java `final` keyword
module SettableStruct
include AbstractStruct
include Synchronization::AbstractStruct

# @!macro struct_values
def values
Expand Down Expand Up @@ -104,7 +104,7 @@ def self.new(*args, &block)
FACTORY = Class.new(Synchronization::Object) do
def define_struct(name, members, &block)
synchronize do
clazz = AbstractStruct.define_struct_class(SettableStruct, Synchronization::Object, name, members, &block)
clazz = Synchronization::AbstractStruct.define_struct_class(SettableStruct, Synchronization::Object, name, members, &block)
members.each_with_index do |member, index|
clazz.send(:define_method, member) do
synchronize { @values[index] }
Expand Down
3 changes: 0 additions & 3 deletions lib/concurrent/struct.rb

This file was deleted.

155 changes: 0 additions & 155 deletions lib/concurrent/struct/abstract_struct.rb

This file was deleted.

Loading