-# The main NoFlo runner
-
+#     NoFlo - Flow-Based Programming for Node.js
+#     (c) 2011 Henri Bergius, Nemein
+#     NoFlo may be freely distributed under the MIT license
 internalSocket = require "./InternalSocket"
 component = require "./Component"
 port = require "./Port"
 arrayport = require "./ArrayPort"
 graph = require "./Graph"
 
+# # The NoFlo network coordinator
+#
+# NoFlo networks consist of processes connected to each other
+# via sockets attached from outports to inports.
+#
+# The role of the network coordinator is to take a graph and
+# instantiate all the necessary processes from the designated
+# components, attach sockets between them, and handle the sending
+# of Initial Information Packets.
 class NoFlo
     processes: {}
     connections: []


        delete @processes[node.id]

    getNode: (id) ->
        @processes[id]


                throw error
        implementation.getComponent()

    # ## Add a process to the network
    # 
    # Processes can be added to a network at either start-up time
    # or later. The processes are added with a node definition object
    # that includes the following properties:
    #
    # * `id`: Identifier of the process in the network. Typically a string
    # * `component`: Filename or path of a NoFlo component, or a component instance object
    addNode: (node) ->
        # Processes are treated as singletons by their identifier. If
        # we already have a process with the given ID, return that.
        return if @processes[node.id]

        process =
          id: node.id

        # Load the process for the node.
        if node.component
            process.component = @load node.component

        # Store and return the process instance 
        @processes[process.id] = process

    removeNode: (node) ->
