Sorry for my late answer ;)

Yes, I already use Foxx queues for some work, but I'm a bit confused about 
error handling

In the documentation, it says :

Any errors raised by the script will be handled depending on how the script 
was invoked:

   - if the script was invoked from the HTTP API (e.g. using the web 
   interface), it will return an error response using the exception's 
   statusCode property if specified or 500.
   - if the script was invoked from a Foxx job queue, the job's failure 
   counter will be incremented and the job will be rescheduled or marked as 
   failed if no attempts remain.

Since I use it from a Foxx Service, when I throw errors, the job remains in 
progress status and blocks every next jobs. How can I handle this problem ?

My code is :

if(response.statusCode >= 200 && response.statusCode < 300) {
    module.exports = true;
} else {
    throw new errors.EventFailedError("event_failed", eventData);
}

Thanks in advance !
Florian

Le mardi 13 septembre 2016 12:06:25 UTC+2, Claudius Weinberger a écrit :
>
>
> Am 13. September 2016 um 11:07:41, Florian ([email protected] 
> <javascript:>) schrieb:
>
> I have another question about HTTP request in ArangoDB :
>
>
> ArangoDB uses synchronous connections so when we send an HTTP request in a 
> Foxx route, is ArangoDB waiting for the HTTP response before sending its 
> own response ?
>
> Yes, it is. That's why we introduce Foxx Queue. Did you have a look at the 
> Foxx Queues already?
>
>
>
>
> *An example :*
> I have a route in a Foxx service (/createEntity) which :
>
>    - save user data into ArangoDB
>    - send an HTTP request to the SQS (the queue service).
>
> Is the Foxx route waiting for the HTTP request to be sent or return the 
> response immediately after calling request() function ?
>
>
> If it is, is it interesting to create a Foxx queue which handles these 
> HTTP requests ? Is there another way to not wait ?
>
> Thanks in advance !
>
> Florian
> --
> You received this message because you are subscribed to the Google Groups 
> "ArangoDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to