package Tak::STDIOSetup;

use Tak::ConnectionService;
use Tak::Router;
use Tak;
use strictures 1;

sub run {
  open my $stdin, '<&', \*STDIN;
  open my $stdout, '>&', \*STDOUT;
  close STDIN; close STDOUT;
  my $connection = Tak::ConnectionService->new(
    read_fh => $stdin, write_fh => $stdout,
    listening_service => Tak::Router->new
  );
  Tak->loop->loop_forever;
}

1;
