// Get an instance of this class
$discoveryInstance = new DhtRecipientDiscovery();
+ // Get a DHT instance
+ $dhtInstance = DhtObjectFactory::createDhtObjectInstance('node');
+
+ // Set it here
+ $discoveryInstance->setDhtInstance($dhtInstance);
+
// Return the prepared instance
return $discoveryInstance;
}
*
* @param $packageData Valid package data array
* @return $recipients An indexed array with DHT recipients
- * @todo 0% done
*/
public function resolveRecipientsByPackageData (array $packageData) {
- $this->partialStub('Please implement this method. packageData[]=' . print_r($packageData, TRUE));
+ // Use facade to get recipients back
+ $recipients = $this->getDhtInstance()->findRecipientsByPackageData($packageData);
+
+ // Return it
+ return $recipients;
}
}