Skip to content

Commit

Permalink
updated jsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
lucsoft committed Aug 29, 2022
1 parent 510945c commit 6dc4ee1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions data/Streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@ export type StreamingUploadEvents = {
/**
* a streaming file uploader with backpressure.
*
* phases:
* ### Phases:
*
* 1: Auth => (When the WebSocket Opens)
*
* 2: File <= (Backend sends a "file" request)
*
* 3: File Metadata => (Uploader sends a 'file { filename: "", type: ""}' request)
*
* 4: Next <= (Backend Waits for binary data)
*
* 5: *binary* => (Sends a Chunk of the File to the backend)
* [...] (Drains the Buffer to the end)
*
* [...] (Step 4 and 5 gets repeated until the File is send)
*
* 6: End => (Uploader sends "end" Request)
*
* 7: *response* => (Backend sends a finial Response: Should often be a json with an id in it)
*
* Note: In the Future most of the stuff could be reduced to WebSocketStream as it also allows backpressure.
Expand Down

0 comments on commit 6dc4ee1

Please sign in to comment.