Private
Readonly
pingsPrivate
Readonly
policyPrivate
processingPrivate
queuePrivate
Readonly
ratePrivate
recoverablePrivate
waitPrivate
workerClears the pending pings queue.
This will drop pending pings still enqueued.
Only the deletion-request
ping will still be processed.
A promise which resolves once the clearing is complete and all upload attempts have been exhausted.
Private
enqueueEnqueues a new ping at the end of the queue.
Will not enqueue if a ping with the same identifier is already enqueued or is currently being processed.
The ping to enqueue.
Get the next UploadTask
.
The next upload task.
Private
getProcesses the response from an attempt to upload a ping.
Based on the HTTP status of said response, the possible outcomes are:
200 - 299 Success** Any status on the 2XX range is considered a successful upload, which means the corresponding ping file can be deleted.
Known 2XX status: 200 - OK. Request accepted into the pipeline.
400 - 499 Unrecoverable error** Any status on the 4XX range means something our client did is not correct. It is unlikely that the client is going to recover from this by retrying, so in this case the corresponding ping file can also be deleted.
Known 4XX status: 404 - not found - POST/PUT to an unknown namespace 405 - wrong request type (anything other than POST/PUT) 411 - missing content-length header 413 - request body too large Note that if we have badly-behaved clients that retry on 4XX, we should send back 202 on body/path too long). 414 - request path too long (See above)
Any other error** For any other error, a warning is logged and the ping is re-enqueued.
Known other errors: 500 - internal error
The ping that was just uploaded.
The response of a ping upload attempt.
Whether or not to retry the upload attempt.
Enqueues a new ping and trigger uploading of enqueued pings.
This function is called by the PingDatabase every time a new ping is added to the database or when the database is being scanned.
The id of the ping that was just recorded.
An object containing the newly recorded ping path, payload and optionally headers.
Generated using TypeDoc
A ping upload manager. Manages a queue of pending pings to upload.
Observes the pings database and whenever that is updated the newly recorded ping is enqueued.