-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A more general purpose API? #97
Comments
Hi @brodybits, Contributions are always welcome!
export interface Storage {
set(key: string, value: string): Promise<void>;
get(key: string): Promise<?string>;
remove(key: string): Promise<void>;
keys(): Promise<Array<string>>;
} and connection export interface Connection {
onmessage: (ev: MessageEvent) => any;
onopen: (ev: Event) => any;
send(data: string): void;
readyState: number;
} Does it fit your needs? If not, please provide more details. |
Thanks @olebedev for the response, it seems to make sense. I will probably have to read through the code some more to better understand what is needed to get it to properly support multiple tiers, with flexible pluggable components, with some things such as:
I would be happy to raise one or more new issues to discuss, if necessary. I just raised #98 to ask about available documentation. I was also wondering what made you guys decide to merge this as a "monorepo"? |
Looking through https://github.com/gritzko/swarm/tree/master/packages/client I get an impression that it should be possible to achieve some more flexibility by designing it to work with pluggable storage and backend connection drivers.
If we get it right then it may be possible to use the same module on the server side to coordinate between client connections, local cache or data storage, and lower tiers.
I would be happy to work on this idea if there is sufficient interest.
The text was updated successfully, but these errors were encountered: