     else
       @nodeInstance.outPorts[port].sendIP ip
 
+  # Sends packets for each port as a key in the map
+  # or sends Error or a list of Errors if passed such
   send: (outputMap) ->
     if @nodeInstance.ordered and
     not ('__resolved' of @result)


  isStarted: -> @started

  # Sets process handler function
  process: (handle) ->
    unless typeof handle is 'function'
      throw new Error "Process handler must be a function"
    unless @inPorts
      throw new Error "Component ports must be defined before process function"
    @handle = handle
    for name, port of @inPorts.ports
      do (name, port) =>

    for port, packet of outputMap
      @sendIP port, packet

  # Alias for `complete()`
  sendDone: (outputMap) ->
    @complete outputMap

  # Sends the argument via `send()` and marks activation as `done()`
  complete: (outputMap) ->
    @send outputMap
    @done()

  # Makes a map-style component pass a result value to `out`
  # keeping all IP metadata received from `in`,
  # or modifying it if `options` is provided
  pass: (data, options = {}) ->
    unless 'out' of @ports
      throw new Error 'output.pass() requires port "out" to be present'
    for key, val of options
      @ip[key] = val
    @ip.data = data
    @sendIP 'out', @ip
    @done()

  # Finishes process activation gracefully
  done: (error) ->
    @error error if error
    if @nodeInstance.ordered
