This PR tries to address #51 by moving certain "background processes" such as sending messages for failure detection and dissemination out of the server and into an Lwt.async call. This means the server can block as much as it wants waiting for new messages and handling them before continuing. The original reason for this was to remove the fixed interval between server iterations due to the fact that messages were being received/handled in a separate thread which was not being awaited. However, I have found that this approach does not actually allow us to remove the fixed interval. It is still necessary for the interval to be there in the function called with Lwt.async, or things begin to stall. I am not sure if this change is desirable.
This PR tries to address #51 by moving certain "background processes" such as sending messages for failure detection and dissemination out of the server and into an
Lwt.async
call. This means the server can block as much as it wants waiting for new messages and handling them before continuing. The original reason for this was to remove the fixed interval between server iterations due to the fact that messages were being received/handled in a separate thread which was not being awaited. However, I have found that this approach does not actually allow us to remove the fixed interval. It is still necessary for the interval to be there in the function called withLwt.async
, or things begin to stall. I am not sure if this change is desirable.