start_import() public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/shell/system-command.rb, line 82
    def start_import
#      Thread.critical = true
      notify "Job(%id) start imp-pipe.", @shell.debug?
      rs = @shell.record_separator unless rs
      _eop = true
#      Thread.critical = false
      th = Thread.start {
        Thread.critical = true
        begin
          Thread.critical = false
          while l = @pipe_in.gets
            @input_queue.push l
          end
          _eop = false
        rescue Errno::EPIPE
          _eop = false
        ensure
          if _eop
            notify("warn: Process finishing...",
                   "wait for Job[%id] to finish pipe importing.",
                   "You can use Shell#transact or Shell#check_point for more safe execution.")
#           Tracer.on
            Thread.current.run
            redo
          end
          Thread.exclusive do
            notify "job(%id}) close imp-pipe.", @shell.debug?
            @input_queue.push :EOF
            @pipe_in.close
          end
        end
      }
    end
Register or log in to add new notes.