#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
#[allow(non_upper_case_globals)]
#[unsafe(export_name = "malloc_conf")]
pub static malloc_conf: &[u8] =
b"background_thread:true,dirty_decay_ms:53000,muzzy_decay_ms:57000\0";
use clap::Parser;
use melin_server::app_factory::{Factory, FactoryConfig};
use melin_server::event_publisher;
use melin_server::request_decoder::RequestDecoder;
use melin_server::response_encoder::ResponseEncoder;
use melin_server_runtime::server::{self, ServerConfig};
fn main() -> Result<(), Box<dyn std::error::Error>> {
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.with_target(true)
.with_thread_names(true)
.init();
let config = ServerConfig::parse();
let factory = Factory::new(FactoryConfig {
accounts: config.accounts,
instruments: config.instruments,
max_orders_per_account: config.max_orders_per_account,
max_orders_per_second: config.max_orders_per_second,
max_orders_burst: config.max_orders_burst,
});
server::run(
config,
factory,
RequestDecoder,
ResponseEncoder,
Some(event_publisher::run),
)
}