mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
play with the crawler!
This commit is contained in:
parent
c582e18cfa
commit
3c572559b7
1 changed files with 8 additions and 1 deletions
|
|
@ -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"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue