docs: function(opts) {
    if (!(this instanceof GridControl))
      return new GridControl(opts);
  
    var that = this;
  
    this.peer_name        = opts.peer_name        || Moniker.choose();
    this.peer_api_port    = opts.peer_api_port    || 10000;
    this.private_ip       = InternalIp.v4();
    this.processing_tasks = [];
    this.peer_list        = [];
    this.socket_pool      = new SocketPool();
    this.namespace        = process.env.GRID      || opts.namespace;
    this.password         = process.env.GRID_AUTH || opts.password || null;
  
    var conf = null;
  
    try {
      conf = JSON.parse(fs.readFileSync(defaults.CONF_FILE));
    } catch(e) {}
  
    if (!this.namespace) {
      this.namespace = conf ? conf.namespace : defaults.GRID_NAME;
      this.password  = conf ? conf.password  : null;
    }
  
    fs.writeFileSync(defaults.CONF_FILE, JSON.stringify({
      namespace : this.namespace,
      password  : this.password
    }));
  
    /**
     * File manager initialization
     */
  
    if (!opts.file_manager)
      opts.file_manager = {};
  
    this.root_folder = opts.file_manager.root_folder || defaults.TMP_FOLDER;
    this.app_folder  = opts.file_manager.app_folder || path.join(this.root_folder, 'app');
  
    this.file_manager = new FilesManagement({
      root_folder    : this.root_folder,
      app_folder     : this.app_folder
    });
  
    /**
     * Task manager initialization
     */
    var task_manager_opts = {
      port_offset : parseInt(that.peer_api_port) + 1,
      app_folder  : this.app_folder
    };
  
    if (opts.task_manager && opts.task_manager.task_meta) {
      task_manager_opts.task_meta = opts.task_manager.task_meta;
    }
  
    this.task_manager = new TaskManager(task_manager_opts);
  
    /**
     * Load balancer initialization
     */
    this.load_balancer = new LoadBalancer();
  
    /**
     * Start Worker
     */
    this.startWorker();
  
    /**
     * API initialization
     */
    this.api = new API({
      load_balancer: that.load_balancer,
      task_manager : that.task_manager,
      file_manager : that.file_manager,
      net_manager  : this,
      port         : that.peer_api_port
    });
  
    // process.on('SIGINT', () => {
    //   this.close(() => {
    //     process.exit(0);
    //   });
    // });
  }