observe Peers V2
Request information about Ditto peers in the local peer-to-peer network. The V2 observer differs from observePeers
by providing not just information about the immediate peers, but also multihop information from other peers not immediately connected. V2 presence therefore offers a more complete view of the local peer-to-peer network.
This method returns an observer which will invoke the provided lambda for each update. A newly registered observer will have an update delivered to it immediately. Then it will be invoked repeatedly when new information is learned about Ditto peers or their connections in the local peer-to-peer network.
When the observer is no longer required the caller must call close()
on the returned DittoPeersObserver
.
Parameters
the lambda to be invoked when there is an update.
Request information about Ditto peers in the local peer-to-peer network. The V2 observer differs from observePeers
by providing not just information about the immediate peers, but also multihop information from other peers not immediately connected. V2 presence therefore offers a more complete view of the local peer-to-peer network.
This method returns an observer which will invoke the update
method on the provided callback object for each update. A newly registered observer will have an update delivered to it immediately. Then it will be invoked repeatedly when new information is learned about Ditto peers or their connections in the local peer-to-peer network.
When the observer is no longer required the caller must call close()
on the returned DittoPeersObserver
.
Parameters
an object that implements the DittoPeersObserverV2Callback interface, whose update
function will be called when there is an update.