acheong08 / acheong08/obi-sync-lib

Library Design

オープン
#1 コメント 41 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
21
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

説明

I need some advice on how the websocket connection should work in JS and how data should be returned from the library. The current implementation is an experiment and should not be taken seriously.

The design in my head:
`Connect(vaultID: string, keyHash: string, token: string)` - Returns some sort of channel (Or whatever the equivalent is in JavaScript). Spawn a thread in the plugin to listen to push operations from the server.

`Pull(uid: string)` - Sends a pull request through the websocket. Returns the binary and metadata

`Push(...)` etc

At least this is how I would do this in Golang. However, in JS, websockets are implemented with an `onmessage` callback. I do not know of a way to receive objects in order and know what type of message is being received.

CC @oskardotglobal

- https://github.com/acheong08/obi-sync/issues/29

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

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

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