API Efficiency

For discussion of the Poker Mavens server module and other administration topics
Post Reply
RafalNiewinski
Posts: 13
Joined: Mon Nov 16, 2015 9:54 am

API Efficiency

Post by RafalNiewinski »

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?
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: API Efficiency

Post by Kent Briggs »

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.
RafalNiewinski
Posts: 13
Joined: Mon Nov 16, 2015 9:54 am

Re: API Efficiency

Post by RafalNiewinski »

Ok, what is the timeout, how much time do I have to process information?
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: API Efficiency

Post by Kent Briggs »

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.
Post Reply