Anonymous avatar Anonymous committed efbd4ad Merge

merged master

Comments (0)

Files changed (3)

 (* let ()  = reset ~until:3 () *)
 
 let _ =
-  try 
-    while true do 
-      (* List.iter parse_instruction_eoi lines *)
-      let line = read_line () in
-      let ()  =  prerr_endline line in
-      parse_instruction_eoi line
-    done
-  with
-    End_of_file ->
-      prerr_endlinef "finished"
-        
+
+  let () = reset ~until:5 () in
+  let file_name = Sys.argv.(1) in
+  if Sys.file_exists file_name then 
+    let chan = open_in file_name in
+    try      
+      while true do 
+        (* List.iter parse_instruction_eoi lines *)
+        let line = input_line chan in 
+        let ()  =  prerr_endline line in
+        parse_instruction_eoi line
+      done
+    with
+      End_of_file ->
+        prerr_endlinef "finished"
+  else 
+    prerr_endlinef "file %snot exists" file_name
 
 then you will see a link to DSL_util.byte
 
-         ./DSL_util.byte < leader_sce.ml
+         ./DSL_util.byte  leader_sce.ml
          or type line by line to check
          leader_sce.ml is a very *complex* scenario, it will generate more than
          3000 messages.
          (alice bob marry) 1000 interval 0.00
          means the three guys will take turns to speak, with interval 0.00
          (so concurrency happens here), and do it 1000 times
-         
+
          the log is in the same directory, after it finished,
          i.e,
          alice.log, alice.err.log
 time 1
 alice via bob
 time 1
-(alice bob  marry )   1000 interval 0.00  
+(alice bob  marry )   10 interval 0.03  
 alice: "bob !!"
 time 1
  (* test leader election *)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.