Skip to content
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

Open
davidbau opened this issue Feb 13, 2014 · 0 comments
Open

Implement a network and storage API #34

davidbau opened this issue Feb 13, 2014 · 0 comments

Comments

@davidbau
Copy link
Member

Here is a proposed api:

Storage:
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 pencilcode.net itself, including new programs.

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

See http://stackoverflow.com/questions/16392260/which-websocket-library-to-use-with-node-js for alternative websocket libraries to consider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant