acheong08 / acheong08/obi-sync-lib

Library Design

Đang mở
#1 41 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
21
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.