Skip to content
Closed
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: 2 additions & 2 deletions lib/async/container/best.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def self.fork?

def self.best_container_class
if fork?
return Forked
Forked
else
return Threaded
Threaded
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/async/container/channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def close
def receive
if data = @in.gets
begin
return JSON.parse(data, symbolize_names: true)
JSON.parse(data, symbolize_names: true)
rescue
return {line: data}
{line: data}
end
end
end
Expand Down
10 changes: 5 additions & 5 deletions lib/async/container/generic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def spawn(name: nil, restart: false, key: nil, &block)
# Async.logger.error(self) {$!} if $!
end.resume

return true
true
end

def async(**options, &block)
Expand All @@ -174,7 +174,7 @@ def run(count: Container.processor_count, **options, &block)
spawn(**options, &block)
end

return self
self
end

def reload
Expand All @@ -188,7 +188,7 @@ def reload
value.stop? && (dirty = true)
end

return dirty
dirty
end

def mark?(key)
Expand All @@ -200,7 +200,7 @@ def mark?(key)
end
end

return false
false
end

def key?(key)
Expand All @@ -221,7 +221,7 @@ def insert(key, child)

@state[child] = state

return state
state
end

# Clear the child (value) as running.
Expand Down
2 changes: 1 addition & 1 deletion lib/async/container/hybrid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def run(count: nil, forks: nil, threads: nil, **options, &block)
end
end

return self
self
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/async/container/keyed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def clear!
def stop?
unless @marked
@value.stop
return true
true
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/async/container/notify/pipe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def environment_for(arguments)
arguments.unshift(environment = Hash.new)
end

return environment
environment
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/async/container/notify/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def self.load(message)
next [key.downcase.to_sym, value]
end

return Hash[pairs]
Hash[pairs]
end

def self.generate_path
Expand Down
2 changes: 1 addition & 1 deletion lib/async/container/notify/socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def dump(message)
buffer << "#{key.to_s.upcase}=#{value}\n"
end

return buffer
buffer
end

def send(**message)
Expand Down
4 changes: 2 additions & 2 deletions lib/async/container/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def self.for(process)

instance.name = process.name

return instance
instance
end

def initialize(io)
Expand Down Expand Up @@ -156,7 +156,7 @@ def wait
end
end

return @status
@status
end
end
end
Expand Down
6 changes: 2 additions & 4 deletions lib/async/container/thread.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ def error

class Instance < Notify::Pipe
def self.for(thread)
instance = self.new(thread.out)

return instance
self.new(thread.out)
end

def initialize(io)
Expand Down Expand Up @@ -148,7 +146,7 @@ def wait
@waiter = nil
end

return @status
@status
end

class Status
Expand Down