play with the crawler!

This commit is contained in:
Simon Cruanes 2013-03-30 15:04:20 +01:00
parent c582e18cfa
commit 3c572559b7

View file

@ -3,7 +3,7 @@
open Batteries open Batteries
let pool = Future.Pool.create ~timeout:15. ~size:15 let pool = Future.Pool.create ~timeout:15. ~size:50
let split_lines s = String.nsplit s ~by:"\n" let split_lines s = String.nsplit s ~by:"\n"
@ -50,6 +50,13 @@ let main from into =
with Not_found -> with Not_found ->
Format.printf "no path could be found@." Format.printf "no path could be found@."
let _ =
let timer = Future.Timer.create () in
let rec ping () =
Format.printf "*** ping! (size of pool: %d)@." (Future.Pool.size pool);
Future.Timer.schedule_in timer 10. ping
in ping ()
let _ = let _ =
if Array.length Sys.argv < 3 if Array.length Sys.argv < 3
then Format.printf "usage: crawl url1 url2" then Format.printf "usage: crawl url1 url2"