On Friday 01 August 2008 22:01, Julien Cornuwel wrote:
> Hi,
> 
> I'm considering using HLSimpleClient for the WoT plugin but I can't
> figure how I can use it to do persistent requests (non-blocking).

HLSC doesn't do persistent requests. You'll have to create them directly. The 
two obvious code examples are fproxy and HLSCImpl itself. Basically you need 
to set MaxRetries to -1 on the context object; you probably don't want it to 
be actually persistent (i.e. stored on disk), but you do want it 
non-blocking. HLSCImpl creates a ClientGetter, feeds it a callback object and 
uses that to do blocking; if you can emulate this you can do what you want 
(most everything is available through Node). Alternatively, we could add a 
method on HighLevelSimpleClient to do this for you - you'd feed it a 
FetchContext and a ClientCallback ... Added the necessary method in SVN 
r21572.

FetchContext fetchContext = hlsc.getFetchContext();
fetchContext.maxSplitfileBlockRetries = -1; // retry forever
fetchContext.maxNonSplitfileRetries = -1; // retry forever
hlsc.fetch(uri, maxSize, contextObject, callback, fetchContext);

If this doesn't throw then the callback will be called when it is done.
> 
> Am I missing something ? If not, how can a plugin do such requests and
> be notified when the key is found ?
> 
> Regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20080802/e0786d22/attachment.pgp>

Reply via email to