Module: Capistrano::Processable

Module | Capistrano::Processable
In: | lib/capistrano/processable.rb lib/capistrano/processable.rb

### Methods

ensure_each_session ensure_each_session process_iteration process_iteration

### Classes and Modules

Module Capistrano::Processable::SessionAssociation

### Public Instance methods

ensure_each_session() {|session| ...}

[Source]

        # File lib/capistrano/processable.rb, line 38
    38:     def ensure_each_session
    39:       errors = []
    40:
    41:       sessions.each do |session|
    42:         begin
    43:           yield session
    44:         rescue Exception => error
    45:           errors << SessionAssociation.on(error, session)
    46:         end
    47:       end
    48:
    49:       raise errors.first if errors.any?
    50:       sessions
    51:     end

ensure_each_session() {|session| ...}

[Source]

        # File lib/capistrano/processable.rb, line 38
    38:     def ensure_each_session
    39:       errors = []
    40:
    41:       sessions.each do |session|
    42:         begin
    43:           yield session
    44:         rescue Exception => error
    45:           errors << SessionAssociation.on(error, session)
    46:         end
    47:       end
    48:
    49:       raise errors.first if errors.any?
    50:       sessions
    51:     end

process_iteration(wait=nil, &block)

[Source]

        # File lib/capistrano/processable.rb, line 16
    16:     def process_iteration(wait=nil, &block)
    17:       ensure_each_session { |session| session.preprocess }
    18:
    19:       return false if block && !block.call(self)
    20:
    21:       readers = sessions.map { |session| session.listeners.keys }.flatten.reject { |io| io.closed? }
    22:       writers = readers.select { |io| io.respond_to?(:pending_write?) && io.pending_write? }
    23:
    24:       if readers.any? || writers.any?
    25:         readers, writers, = IO.select(readers, writers, nil, wait)
    26:       end
    27:
    28:       if readers
    29:         ensure_each_session do |session|
    30:           ios = session.listeners.keys
    31:           session.postprocess(ios & readers, ios & writers)
    32:         end
    33:       end
    34:
    35:       true
    36:     end

process_iteration(wait=nil, &block)

[Source]

        # File lib/capistrano/processable.rb, line 16
    16:     def process_iteration(wait=nil, &block)
    17:       ensure_each_session { |session| session.preprocess }
    18:
    19:       return false if block && !block.call(self)
    20:
    21:       readers = sessions.map { |session| session.listeners.keys }.flatten.reject { |io| io.closed? }
    22:       writers = readers.select { |io| io.respond_to?(:pending_write?) && io.pending_write? }
    23:
    24:       if readers.any? || writers.any?
    25:         readers, writers, = IO.select(readers, writers, nil, wait)
    26:       end
    27:
    28:       if readers
    29:         ensure_each_session do |session|
    30:           ios = session.listeners.keys
    31:           session.postprocess(ios & readers, ios & writers)
    32:         end
    33:       end
    34:
    35:       true
    36:     end

[Validate]