🚀 Feature: Improve Storage API by adding streamed responses

オープン
#745 コメント 0 件 リアクション 5 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
android, kotlin
領域
api, tooling

調査の方向性

まず、SDKテンプレート全体で生成される getFileView、getFileDownload、getFilePreview のエントリポイントを追跡し、次に issue にリンクされている Android の getFileStream の変更と比較します。サポート対象の SDK 向けに互換性のあるストリーミングレスポンスのアプローチを定義し、既存のバイト配列メソッドを維持したうえで、生成された API が既存の呼び出し元を壊すことなく新しいオプションを公開することを検証します。

索引モデルが issue の本文から書いたものです。

説明

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?
主要言語
Twig
スター
330
フォーク
212
平均マージ
12時間 3分
マージ済み PR(30日)
131

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

appwrite/sdk-generator のほかの issue

appwrite/sdk-generator の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。