 withActor = (type, actor) ->
   _with 'Actor', type, actors, actor
 
-
 withAdapter = (type, adapter) ->
   _with 'Adapter', type, adapters, adapter
 

adapters = {}
serializers = {}


_with = (name, type, array, clazz) ->
  if not type then throw new Error "#{name}'s type undefined"

    name = pair[1]
    array[name]=require "./#{type}/#{name}"

# Load in the factory all hComponent (Actors, Adapters, ... )  contained in a directory
loadCustom = (pathToLoad,cb_with) ->
  results = walkSync pathToLoad
  _(results).each (file) ->
    ext = path.extname(file)
    return if ext isnt ".coffee"
    # Built the relative name 
    # actors/myActor.coffe 
    # => type : myActor
    relative = path.relative(pathToLoad,file)
    type = relative.match(/(.+)\.coffee$/)[1]
    cb_with type,file 


loadBuiltin builtinActorNames,actors,"actors"
