Package org.jcsp.lang

Interface ChannelInput<T>

    • Method Detail

      • read

        T read()
        Read an Object from the channel.
        Returns:
        the object read from the channel
      • startRead

        T startRead()
        Begin an extended rendezvous read from the channel. An extended rendezvous is not completed until the reader has completed its extended action. This method starts an extended rendezvous. When a writer to this channel writes, this method returns what was sent immediately. The extended rendezvous continues with reader actions until the reader invokes endRead. Only then will the writer be released (from its write method). The writer is unaware of the extended nature of the communication.

        The reader process must call endRead at some point after this function, otherwise the writer will not be freed and deadlock will probably follow.

        The reader process may perform any actions between calling startRead and endRead, including communications on other channels. Further communications on this channel, of course, should not be made.

        An extended rendezvous may be started after the channel's Guard has been selected by an Alternative (i.e. startRead instead of read).

        Returns:
        The object read from the channel
      • endRead

        void endRead()
        End an extended rendezvous. It must be invoked once (and only once) following a startRead.