API Efficiency

For discussion of the Poker Mavens server module and other administration topics

API Efficiency

Postby RafalNiewinski » Thu Feb 25, 2016 4:23 pm

Hello Kent,

I would like to ask you something about API Callbacks.
I am building infrastructure with lots of API calls to PM Server and lots of Events called back from PM Server to my endpoint.
I am a little bit worry about fail requests (like server 500 codes), can you tell me something about callbacks implementation.

Tell me whether the callbacks operates asynchronously or anyone waiting in the queue and they are sent one a once?
RafalNiewinski
 
Posts: 13
Joined: Mon Nov 16, 2015 9:54 am

Re: API Efficiency

Postby Kent Briggs » Thu Feb 25, 2016 4:36 pm

Callbacks are added to a queue and then a dedicated thread simply runs in a loop, pulling the oldest one from the queue and makes the http call. It waits for a response from your web server before repeating the loop. The queue is currently set to hold up to 500 callback requests. Any overflows are ignored.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3936
Joined: Wed Mar 19, 2008 8:47 pm

Re: API Efficiency

Postby RafalNiewinski » Thu Feb 25, 2016 4:47 pm

Ok, what is the timeout, how much time do I have to process information?
RafalNiewinski
 
Posts: 13
Joined: Mon Nov 16, 2015 9:54 am

Re: API Efficiency

Postby Kent Briggs » Thu Feb 25, 2016 7:59 pm

RafalNiewinski wrote:Ok, what is the timeout, how much time do I have to process information?


I'm not setting a timeout value so it's using the default value for the component (Indy TIdHTTP). I'm not sure what that value is (can't find it in the docs) but I suspect it's at least a minute or two. If you're expecting to handle a large volume with some slow-executing code, you might want to just queue those up and return immediately and let a secondary process perform the actual work.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3936
Joined: Wed Mar 19, 2008 8:47 pm


Return to Site Administration

Who is online

Users browsing this forum: No registered users and 4 guests

cron