🚀 Feature: Improve Storage API by adding streamed responses

Aperta
#745 0 commenti 5 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
android, kotlin
Ambito
api, tooling

Direzione di ricerca

Inizia tracciando gli entry point generati getFileView, getFileDownload e getFilePreview nei template degli SDK, quindi confronta la modifica Android getFileStream collegata nell’issue. Definisci un approccio compatibile per le risposte in streaming per gli SDK supportati, conserva i metodi esistenti basati su array di byte e verifica che le API generate espongano la nuova opzione senza interrompere i chiamanti attuali.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
🔖 Feature description

Currently, getFileView/Download/Preview return byte arrays.
This will force the user to wait for the whole download to be complete, before he gets a response from the client call.
Also, the whole file will be held in RAM.

Previously, i ran into issues downloading big files: https://github.com/appwrite/sdk-for-android/issues/44

Here are some pros for this feature:

  1. Reduced Memory Usage:
    Streaming allows data to be processed in smaller chunks rather than loading the entire content into memory.
  2. Handling Large Files:
    Streaming is particularly useful for handling large files, such as videos or high-resolution images. It allows applications to start playing or displaying content without waiting for the entire file to be downloaded
🎤 Pitch

I see two possible ways to implement this feature:

  1. Simply replace ByteArray with InputStream -> WILL BREAK COMPATIBILITY
  2. Add three functions, suffixed with "Streamed" for example, enabling users to choose between ByteArray and InputStream without breaking their current implementations."
  3. Make use of generics, allowing the user to specify the return type: getFileDownload<InputStream>() (Maybe not possible for every language)

In my case, i added a new function getFileStream to the Android SDK that returns an InputStream instead of a byte array.
https://github.com/joern-h/sdk-for-android/commit/60d10be7567dd67d119e30e252cea690a7cbcb96

👀 Have you spent some time to check if this issue has been raised before?
  • I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
Lingua principale
Twig
Stelle
330
Fork
212
Merge medio
12h 3m
PR unite (30g)
131

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di appwrite/sdk-generator

Tutte le issue di appwrite/sdk-generator

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.