From 3c572559b7f69c08ec6f1872e60862e0b8a39556 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sat, 30 Mar 2013 15:04:20 +0100 Subject: [PATCH] play with the crawler! --- examples/crawl.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/crawl.ml b/examples/crawl.ml index 5bb06157..bfe8496d 100644 --- a/examples/crawl.ml +++ b/examples/crawl.ml @@ -3,7 +3,7 @@ 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" @@ -50,6 +50,13 @@ let main from into = with Not_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 _ = if Array.length Sys.argv < 3 then Format.printf "usage: crawl url1 url2"