• Mart Lubbers's avatar
    Add ondestroy handler for tcp connections · fe8fa967
    Mart Lubbers authored
    Normally you can gracefull clean up in iTasks by hooking into the
    onDisconnect handler, however, if the IOtask is destroyed by for example
    a step, it was impossible to gracefully close the connection.
    
    To fix this, this commit:
    
    - Patches the tcp connections used internally (async, {web,sds}service, tonic)
    - Adapts the wrapping tasks from Internal.Task
    - Adapts processIOTask to get an onDestroy handler
    - When an IOTask is destroyed, read the task state once more, call the
      onDestroy handler and possibly write some data once more. This can be
      used to gracefully close any connections to services that cannot
      reasonably detect broken TCP connections
    fe8fa967
TaskServer.icl 31.6 KB