Esempio n. 1
0
real_core::real_core(const config & conf)
  :
    config_(conf),

    instrumentation_(conf),

    executor_pool_(instrumentation_, conf),

    main_loop_(make_main_async_loop()),

    scheduler_(new real_scheduler()),

    externals_(new real_external(conf, instrumentation_)),

    streams_(new streams(conf, instrumentation_)),

    pubsub_(new pub_sub()),

    index_(new real_index(*pubsub_, [=](e_t e) { streams_->push_event(e); },
                          conf.index_expire_interval, *scheduler_,
                          instrumentation_, detach_thread)),

    tcp_server_(init_tcp_server(conf, *main_loop_, *streams_,
                executor_pool_, instrumentation_)),

    udp_server_(init_udp_server(conf, streams_)),

    ws_server_(init_ws_server(conf, *main_loop_, *pubsub_, *index_))
{

  if (conf.enable_internal_metrics) {
    start_instrumentation(*scheduler_, instrumentation_, *streams_);
  }

}
Esempio n. 2
0
void ICACHE_FLASH_ATTR init_http_server(){

	//general max tcp conns
	espconn_tcp_set_max_con(20);

	http_server_init();
	http_server_bind_domain(INTERFACE_DOMAIN);
	http_server_enable_captive_portal();
	http_server_enable_cors();

	http_server_rewrite(&rewrites);
	http_server_bind_urls((http_server_url *)&api_urls);

	http_server_start();

	//ws
	init_ws_server();

}