   isSubgraph: ->
     true
 
-  shutdown: ->
-    return unless @network
-    @network.stop()
+  shutdown: (callback) ->
+    unless callback
+      callback = ->
+    return callback null unless @network
+    @network.stop callback
 
 exports.getComponent = (metadata) -> new Graph metadata

        return if @isStarted()
        do @start

    for portName, port of process.component.outPorts
      continue if not port or typeof port is 'function' or not port.canAttach
      targetPortName = @isExportedOutport port, name, portName
      continue if targetPortName is false
      @outPorts.add targetPortName, port

      @network.connect (err) =>
        return @error err if err
        notReady = false
        for name, node of @network.processes
          notReady = true unless @checkComponent name, node
        do @setToReady unless notReady
    , true

  start: (callback) ->
    unless callback
      callback = ->
    unless @isReady()
      @on 'ready', =>
        @start callback
      return

    return callback null unless @network
    @network.start (err) =>
      return callback err if err
      @started = true

  checkComponent: (name, process) ->
    unless process.component.isReady()
