Advertisement
Guest User

Change timeout

a guest
Feb 12th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.60 KB | None | 0 0
  1. #!/usr/bin/liquidsoap
  2.  
  3. set("log.stdout", true);
  4. set("server.telnet", true);
  5.  
  6. timeout = ref 180.;
  7.  
  8. def timeout.callback() =
  9.   print("callback is called by timeout, ts: " ^ string_of(gettimeofday()));
  10.   !timeout;
  11. end
  12.  
  13. def timeout.change(value) =
  14.   timeout := float_of_string(value);
  15.   "new timeout: " ^ string_of(!timeout);
  16. end
  17.  
  18. add_timeout(fast = false, !timeout, timeout.callback);
  19.  
  20. server.register(namespace = "timeout",
  21.   description = "Changes current timeout",
  22.   usage = "change <timeout>", "change", timeout.change);
  23.  
  24. security = single("/home/security.mp3");
  25. output.dummy(security)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement