#include "async.h"

void
hello()
{
  warn << "Hello, World!\n";
}

void
hellostr(str foo)
{
  warn << foo << "\n";
}

void
hellostrint(str foo, int bar)
{
  warn << foo << ", " << bar << "\n";
}


void
stupid_callback(callback<void>::ref cb)
{
  warn << "stupid_callback\n";
  cb();
}

int
main(int argc, char *argv[])
{
  async_init();

  callback<void>::ref foo1 = wrap(hello);
  callback<void>::ref foo2 = wrap(hellostr, "Goodbye, World!");
  callback<void>::ref foo3 = wrap(hellostrint, "Fairwell, World!", 3);
  delaycb(1, 0, wrap(stupid_callback, foo1));
  delaycb(2, 0, wrap(stupid_callback, foo2));
  delaycb(3, 0, wrap(stupid_callback, foo3));
  amain();
}
