-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@onServerInit vs @onWorkerStart #17
Comments
Yes but it only needs to be run one time at the beginning. Except if I did not understand how works workers |
Workers are separated processes, started by the daemon. When a worker start @onWorkerStart is called. Just one time for each worker. |
That's problematic since it seems that I can only use one ADI handle at a time, or it will break. How can I do. When I compare my old archttp implementation with the new experimental serverino one, I can see that the older one always respond with the needed data while the serverino will fail and break after few requests. Tested by running this command to stress test the server:
|
But they live in different processes. There is no data shared between responders. Each responder is completly isolated. If you run 4 responder, you're running 4 different instances each one with a single ADI handle. Is this a problem? |
I don't really know how ADI exactly works. What I described is not related to the location of the ADI instructions (if they are in onServerInit or in onWorkerStart), it happens with both locations. The only thing I really know is that ADI functions break with the serverino version, and that ADI interracts with a file on the filesystem located at |
Switching back to archttp for now. |
I think you want to run this initialization inside a function marked with UDA @onWorkerStart .
Provision/anisette_server/app.d
Line 15 in 57e9fee
Functions marked with @OnServerInit are executed just one time by the daemon not by the process that reply to your http request.
The text was updated successfully, but these errors were encountered: