Class ChatCollection

java.lang.Object
edu.tufts.hrilab.llm.serviceproviders.tr.social.ChatCollection

public class ChatCollection extends Object
  • Method Details

    • grabInputLock

      public boolean grabInputLock(Utterance incoming)
    • grabInputLock

      public boolean grabInputLock(Utterance incoming, boolean allowReentry)
      Method to wait for and grab lock to safely start processing an input Utterance and apply side effects to all member ChatContexts. Note that any member variables may have been modified between the start of and returning from this call. To release the lock grabbed from this method, signalInputProcessed must be called with the same Utterance (or simply one with matching Utterance ID). With allowReentry set, a call with the Utterance already being processed returns immediately without taking another claim.
      Parameters:
      incoming - Related Utterance to be processed in conjunction with the grabbed input lock
      allowReentry - whether a call with the Utterance already being processed may proceed instead of waiting
      Returns:
      shouldProcess - indication of whether signalInputProcessed has already been called with the corresponding Utterance due to an external parser hit (false == external hit occurred).
    • shouldProcess

      public boolean shouldProcess(Utterance utterance)
    • signalInputProcessed

      public void signalInputProcessed(Utterance processed)
      Corresponding unlock method of grabInputLock. Signal that we are done processing the supplied Utterance and applying relevant side effects to member ChatContexts.
    • signalInputProcessed

      public void signalInputProcessed()
      Parameterless unlock method of grabInputLock. Signal that we are done processing the current Utterance and applying relevant side effects to member ChatContexts. Only use this version of the method if you have guarantees on lock state and do not have access to the original Utterance.
    • releaseLocks

      protected void releaseLocks()
      Release all locks for the collection and active context. Only use this method in the case of error recovery.