You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently every request is sync and invokes the node from php via a shell execution.
So web requests seem to be in series and not parallel, plus there is overhead of process invokation.
Perhaps the best solution would be to make the EI API calls in PHP.
Can even do a "stale ok" caching strategy where if data for the user exists it is returned and then an async call is made to refresh the data in cache for next time.
However, for now we are going to do a hybrid solution but one that is parallel and has less overhead.
First, make a node webserver that can make the protobuf EI API requests and return json. It will be called by PHP over http, locally, without doing shell executions.
Second, have a method in the new web server that can fetch several user infos at once. Later use in PHP in an optimized manner.
The text was updated successfully, but these errors were encountered:
For now getPlayerInfos returns an array of individual getPlayerInfo responses (with payload.data schema). This can be changed if you prefer. For example, if it helps, can change it to an object where the id is the key and payload.data is the value.
This communication is used to access the EI API.
Relevant files:
js/egg-inc.js
app/Api/EggInc.php
Currently every request is sync and invokes the node from php via a shell execution.
So web requests seem to be in series and not parallel, plus there is overhead of process invokation.
Perhaps the best solution would be to make the EI API calls in PHP.
protobuf also has PHP libs:
https://developers.google.com/protocol-buffers/docs/reference/php-generated
https://github.com/protobuf-php/protobuf
Can even do a "stale ok" caching strategy where if data for the user exists it is returned and then an async call is made to refresh the data in cache for next time.
However, for now we are going to do a hybrid solution but one that is parallel and has less overhead.
First, make a node webserver that can make the protobuf EI API requests and return json. It will be called by PHP over http, locally, without doing shell executions.
Second, have a method in the new web server that can fetch several user infos at once. Later use in PHP in an optimized manner.
The text was updated successfully, but these errors were encountered: