Skip to content
  • Andreas Traczyk's avatar
    notifications: stream HTTP data instead of waiting for response · fd2c3787
    Andreas Traczyk authored and Kateryna Kostiuk's avatar Kateryna Kostiuk committed
    The proxy-server route /{key} produces a HTTP stream which reflects values obtained by a DHT get. The stream is not guaranteed to signal termination. Previously we were waiting on a complete response which in several scenarios would never arrive. This causes the stream data to not be parsed, and for the URLSession block until a timeout, which would cause queueing of any incoming notifications.
    
    This commit changes the design to stream the HTTP content and handle lines (JSON) asynchronously as they are received.
    
    Gitlab: #359
    Change-Id: I469bdde0a3c1ad9d0ac46285740c0f55fd377018
    fd2c3787