You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
*/
struct RPS_Sampler;
+/**
+ * A handle to cancel a request.
+ */
+struct RPS_SamplerRequestHandle;
+
/**
* Callback that is called from _get_n_rand_peers() when the PeerIDs are ready.
* Initialise a tuple of samplers.
*
* @param init_size the size the sampler is initialised with
- * @param id with which all newly created sampler elements are initialised
- * @param ins_cb the callback that will be called on every PeerID that is
- * newly inserted into a sampler element
- * @param ins_cls the closure given to #ins_cb
- * @param rem_cb the callback that will be called on every PeerID that is
- * removed from a sampler element
- * @param rem_cls the closure given to #rem_cb
+ * @param max_round_interval maximum time a round takes
* @return a handle to a sampler that consists of sampler elements.
*/
struct RPS_Sampler *
struct GNUNET_TIME_Relative max_round_interval);
+/**
+ * Initialise a modified tuple of sampler elements.
+ *
+ * @param init_size the size the sampler is initialised with
+ * @param max_round_interval maximum time a round takes
+ * @return a handle to a sampler that consists of sampler elements.
+ */
+struct RPS_Sampler *
+RPS_sampler_mod_init (size_t init_size,
+ struct GNUNET_TIME_Relative max_round_interval);
+
+
/**
* A fuction to update every sampler in the given list
*
* #GNUNET_NO if used internally
* @param num_peers the number of peers requested
*/
- void
+struct RPS_SamplerRequestHandle *
RPS_sampler_get_n_rand_peers (struct RPS_Sampler *sampler,
RPS_sampler_n_rand_peers_ready_cb cb,
- void *cls, uint32_t num_peers, int for_client);
+ void *cls, uint32_t num_peers);
+
+/**
+ * Cancle a request issued through #RPS_sampler_n_rand_peers_ready_cb.
+ *
+ * @param req_handle the handle to the request
+ */
+void
+RPS_sampler_request_cancel (struct RPS_SamplerRequestHandle *req_handle);
/**