Author
Topic: RESTful API Server (Read 1015 times)

the server is multithreaded and requests are handled in a pool of threads - half permanents half spwned on demand.the server is indended to run behind a loadbalancing reverse proxy with ssl termination ( HA Proxy or Digital Ocean loadbalancers) thats why any ssl stuff is stripped!!!this backend i focused on serving heavy load JSON for real world mobile apps with frontends build with ionic or react native. the flow is the following when a request arrives the backend finds the application object that will handle it then the app returns a handler object for the path requested and the object handles the request ... then the thread goes to sleep over RTLEvent and does not consume any cpu the idea is to use as many static memory as possible to avoid getmems/freemems and memory fragmentation. even the threads are not TThread class ... everywhere where possible pools of preallocated records are used. ofcourse my own json parser (fpc-xon) is heavely used ) .. i will add hashes to fpc-xon in several days for serving in memory json object db.. node replication is planed

any comments are welcome

and dont forget - this is not a production ready backend yet!!!

P.S: The name UltraMachine is a tribute to my favourite band Depeche Mode ))

the backend test project is named TestMachine.lpryou need also to download the fpc-xon package from my github account because ultramachine is based on fpc-xon ... you need a program like postman or apc ( chrome app) to send queries to the api server

( please not that for the moment this is under heavy developpment and its not functional yet - i'm testing all the parts like threads sockets http parsing etc ..)