Consider using a redis key to keep track of a specific build job, have the build job check that key while sending requests. Send a build job ID back to the client upon making a stratum build request, create an endpoint that expects a build job ID and deletes that redis key.