src/Pure/System/isabelle_process.scala
changeset 45055 55274f7e306b
parent 45027 f459e93a038e
child 45075 6c66e268f8eb
     1.1 --- a/src/Pure/System/isabelle_process.scala	Fri Sep 23 13:43:44 2011 +0200
     1.2 +++ b/src/Pure/System/isabelle_process.scala	Fri Sep 23 13:44:31 2011 +0200
     1.3 @@ -75,16 +75,15 @@
     1.4  }
     1.5  
     1.6  
     1.7 -class Isabelle_Process(timeout: Time, receiver: Isabelle_Process.Message => Unit, args: String*)
     1.8 +class Isabelle_Process(
     1.9 +    timeout: Time = Time.seconds(10),
    1.10 +    use_socket: Boolean = false,
    1.11 +    receiver: Isabelle_Process.Message => Unit = Console.println(_),
    1.12 +    args: List[String] = Nil)
    1.13  {
    1.14    import Isabelle_Process._
    1.15  
    1.16  
    1.17 -  /* demo constructor */
    1.18 -
    1.19 -  def this(args: String*) = this(Time.seconds(10), Console.println(_), args: _*)
    1.20 -
    1.21 -
    1.22    /* results */
    1.23  
    1.24    private def system_result(text: String)
    1.25 @@ -131,13 +130,13 @@
    1.26  
    1.27    /** process manager **/
    1.28  
    1.29 -  private val system_channel = System_Channel()
    1.30 +  private val system_channel = System_Channel(use_socket)
    1.31  
    1.32    private val process =
    1.33      try {
    1.34        val cmdline =
    1.35          Isabelle_System.getenv_strict("ISABELLE_PROCESS") ::
    1.36 -          (system_channel.isabelle_args ::: args.toList)
    1.37 +          (system_channel.isabelle_args ::: args)
    1.38        new Isabelle_System.Managed_Process(true, cmdline: _*)
    1.39      }
    1.40      catch { case e: IOException => system_channel.accepted(); throw(e) }