def search(self, query): # Prepare a message requesting the websocket server to search among its objects message = SearchMessage(query) serialized_message = sy.serde.serialize(message) # Send the message and return the deserialized response. response = self._send_msg(serialized_message) return sy.serde.deserialize(response)
def search(self, query): """ Node's dataset search method overwrite. Args: query: Query used to search by the desired dataset tag. Returns: query_response: Return the peer's response. """ message = SearchMessage(query) serialized_message = sy.serde.serialize(message) response = self._send_msg(serialized_message) return sy.serde.deserialize(response)
def request_search(self, query: List[str], location: "BaseWorker") -> List: """ Add a remote worker to perform a search Args: query: the tags or id used in the search location: the remote worker identity Returns: A list of pointers to the results """ results = self.send_msg(SearchMessage(query), location=location) for result in results: self.register_obj(result) return results
def request_search(self, query: List[str], location: "BaseWorker"): result = self.send_msg(SearchMessage(query), location=location) return result
def search(self, query): message = SearchMessage(query) serialized_message = sy.serde.serialize(message) response = asyncio.run(self._send_msg(serialized_message)) return sy.serde.deserialize(response)