acheong08 / acheong08/obi-sync-lib

Library Design

未关闭
#1 41 条评论 0 个 reaction 已指派 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 摘要。