Class Ex

  • All Implemented Interfaces:
    java.lang.Runnable, EventSubscriber, Fiber.Worker

    public class Ex
    extends Task
    Spawn a task, communicate through a shared mailbox. The task's termination is knowm through another mailbox. The structure of this class is not much different from a Thread version that uses PipedInput/OutputStreams (Task instead of Thread, execute() instead of run(), and typed, buffered mailboxes instead of pipes. [compile] javac -d ./classes Ex.java [weave] java kilim.tools.Weave -d ./classes kilim.examples.Ex [run] java -cp ./classes:./classes:$CLASSPATH kilim.examples.Ex
    • Field Detail

      • mb

        static Mailbox<java.lang.String> mb
    • Constructor Detail

      • Ex

        public Ex()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • execute

        public void execute()
                     throws Pausable
        The entry point. mb.get() is a blocking call that yields the thread ("pausable")
        Specified by:
        execute in interface Fiber.Worker
        Overrides:
        execute in class Task
        Throws:
        Pausable