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

Implement a network and storage API #34

davidbau opened this Issue Feb 13, 2014 · 0 comments


None yet
1 participant

davidbau commented Feb 13, 2014

Here is a proposed api:

netsave 'filename', [options], text
netload 'filename', [options], (text) -> see text

Queuing: exactly one delivery to exactly one receiver. If there are multiple sends, they get queued up for a while (e.g., an hour). Each recv dequeues exactly one message from some sender.
netsend 'filename', [options], text
netrecv 'filename', [options], (text) -> see text

Chatting: broadcast delivery to all listeners, but only those who are listening at the moment.
netchat 'filename', [options], text
neton 'filename', [options], (text) -> see text
netoff 'filename', [callback]

save should be equivalent to $.post('/save/(parentdir)/filename', { data: text })
load should be equivalent to $.get('/load/(parentdir)/filename'...)
In other words, the storage APIs should allow you to load and save new files on itself, including new programs.

The interesting thing here is implementing send/recv/chat/on. These should also bounce off of - on the server, there should be a node.js websocket implementation of send/recv/chat/

See for alternative websocket libraries to consider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment