Advertisement
Guest User

Untitled

a guest
May 8th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [<EntryPoint>]
  2. let main argv =
  3.     let write msg context =
  4.         msg |> context.Response.Write |> ignore // Write returns Future<T>, which we do not want to wait for
  5.         context
  6.     let end context =
  7.     context.Response.End () |> ignore // End returns Future<T>, which we do not want to wait for
  8.    
  9.     Reactor.Loop.Start();
  10.     (* create a interval to tick every now and again. *)
  11.     let interval = Reactor.Interval.Create(fun () ->
  12.         printf "tick\n"
  13.     , 2000.0)
  14.  
  15.     (* testing *)
  16.     Reactor.Http.Server.Create(fun context ->
  17.         context
  18.         |> write "Hello"
  19.         |> end
  20.     ).Listen(5000)
  21.     0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement