Class HandlerQueryable

  • All Implemented Interfaces:
    io.zenoh.session.SessionDeclaration , java.lang.AutoCloseable

    
    public final class HandlerQueryable<R extends Object>
    extends Queryable
                        

    Queryable receiving replies through a Handler.

    Example using the default receiver:

    try (Session session = Zenoh.open(config)) {
        Queryable<BlockingQueue<Optional<Query>>> queryable = session.declareQueryable(keyExpr);
        BlockingQueue<Optional<Query>> receiver = queryable.getReceiver();
        while (true) {
            Optional<Query> wrapper = receiver.take();
            if (wrapper.isEmpty()) {
                break;
            }
            Query query = wrapper.get();
            query.reply(query.getKeyExpr(), "Example reply");
        }
    }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final R getReceiver()
      • Methods inherited from class io.zenoh.query.Queryable

        close, getKeyExpr, isValid, undeclare
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait