     initial.socket.send initial.data
     initial.socket.disconnect()
 
-  sendInitials: ->
+  sendInitials: (callback) ->
+    unless callback
+      callback = ->
+
     send = =>
       @sendInitial initial for initial in @initials
       @initials = []
+      do callback
 
     if typeof process isnt 'undefined' and process.execPath and process.execPath.indexOf('node') isnt -1
       # nextTick is faster on Node.js

    return false unless @started
    @connectionCount > 0

  startComponents: ->
    # Perform any startup routines necessary for every component.
    for id, process of @processes
      process.component.start()

  sendDefaults: ->
    for socket in @defaults
      # Don't send defaults if more than one socket is present on the port.
      # This case should only happen when a subgraph is created as a component

      socket.connect()
      socket.send()
      socket.disconnect()
      do callback

  start: (callback) ->
    unless callback
      callback = ->

    do @stop if @started
    @initials = @nextInitials.slice 0
    @startComponents (err) =>
      return callback err if err
      @sendInitials (err) =>
        return callback err if err
        @started = true
        @sendDefaults callback

  stop: ->
    # Disconnect all connections
