Object Zenoh
-
- All Implemented Interfaces:
public class Zenoh
-
-
Method Summary
Modifier and Type Method Description final Sessionopen(Config config)Open a Session with the provided Config. final HandlerScout<BlockingQueue<Optional<Hello>>>scout(ScoutOptions scoutOptions)Scout for routers and/or peers. final <R extends Any> HandlerScout<R>scout(Handler<Hello, R> handler, ScoutOptions scoutOptions)Scout for routers and/or peers. final CallbackScoutscout(Callback<Hello> callback, ScoutOptions scoutOptions)Scout for routers and/or peers. final UnittryInitLogFromEnv()Initializes the zenoh runtime logger, using rust environment settings. final UnitinitLogFromEnvOr(String fallbackFilter)Initializes the zenoh runtime logger, using rust environment settings or the provided fallback level. -
-
Method Detail
-
open
final Session open(Config config)
- Parameters:
config- The configuration for the session.- Returns:
The Session on success.
-
scout
final HandlerScout<BlockingQueue<Optional<Hello>>> scout(ScoutOptions scoutOptions)
Scout for routers and/or peers.
Scout spawns a task that periodically sends scout messages and waits for Hello replies. Drop the returned Scout to stop the scouting task or explicitly call Scout.stop or Scout.close.
- Parameters:
scoutOptions- Optional ScoutOptions to configure the scouting.- Returns:
A HandlerScout with a BlockingQueue receiver.
-
scout
final <R extends Any> HandlerScout<R> scout(Handler<Hello, R> handler, ScoutOptions scoutOptions)
Scout for routers and/or peers.
Scout spawns a task that periodically sends scout messages and waits for Hello replies. Drop the returned Scout to stop the scouting task or explicitly call Scout.stop or Scout.close.
- Parameters:
handler- Handler to handle the incoming Hello messages.scoutOptions- Optional ScoutOptions to configure the scouting.- Returns:
A HandlerScout with the handler's receiver.
-
scout
final CallbackScout scout(Callback<Hello> callback, ScoutOptions scoutOptions)
Scout for routers and/or peers.
Scout spawns a task that periodically sends scout messages and waits for Hello replies. Drop the returned Scout to stop the scouting task or explicitly call Scout.stop or Scout.close.
- Parameters:
callback- Callback to handle the incoming Hello messages.scoutOptions- Optional ScoutOptions to configure the scouting.- Returns:
A CallbackScout with the handler's receiver.
-
tryInitLogFromEnv
final Unit tryInitLogFromEnv()
Initializes the zenoh runtime logger, using rust environment settings. E.g.:
RUST_LOG=infowill enable logging at info level. Similarly, you can set the variable toerrorordebug.Note that if the environment variable is not set, then logging will not be enabled. See https://docs.rs/env_logger/latest/env_logger/index.html for accepted filter format.
-
initLogFromEnvOr
final Unit initLogFromEnvOr(String fallbackFilter)
Initializes the zenoh runtime logger, using rust environment settings or the provided fallback level. E.g.:
RUST_LOG=infowill enable logging at info level. Similarly, you can set the variable toerrorordebug.Note that if the environment variable is not set, then fallbackFilter will be used instead. See https://docs.rs/env_logger/latest/env_logger/index.html for accepted filter format.
- Parameters:
fallbackFilter- : The fallback filter if theRUST_LOGenvironment variable is not set.
-
-
-
-