Silk-GUI / Silk

GUI for developers and Node OS
http://silkgui.com
BSD 2-Clause "Simplified" License
13 stars 5 forks source link

Standard Commmunication Layer Between Socket/JSChannel/Etc #6

Open formula1 opened 10 years ago

formula1 commented 10 years ago

As it is, Communication between Frames is done through JsChannel, Server and Client Websockets and I'm guessing you'll probably want to implement RTC at some point as well (not because its necessary but because its fun). However, the communication between everything is different. Theres a few things that I've thought about

The Question

What is the best way for our system to communicate with itself?

Why is this important

People (including me) generally don't want to learn 5+ different ways of doing very similar tasks

Necessities

It doesn't have to be that specific syntax but I believe there is potential. I believe you were starting this with silk but am not 100% sure.

zodern commented 10 years ago

There are 2 places that need to communicate:

Eventually we might want to add a server api, but so far there hasn't been a need.

I'm guessing you'll probably want to implement RTC at some point as well

I haven't thought of it yet.

Remote Applications

I plan to have an app for users to create custom apps. The user can put in a name, url, icon and maybe a couple other settings. There is a lot of potential like what you mentioned.

Options

I prefer the promises and pub sub. Callbacks seem to get more complex.

Should streams be enabled by something like methods.stream()? The examples I have found have a node client. Do web pages treat streams as a normal response?

$("Application.editor[accepts=text/html]") .openFile("path/to/the.file") .done(function(){ $(this).focus() }).error(function(){ $("Application.packagemanager[serves=apps]") .focus() .search("Applications.editor[accepts=text/html]") });

I really like that idea. One concern is would it require storing the data in the DOM?

I have decided to read Javascript Patterns to better understand Javascript.

zodern commented 10 years ago

Starting and Stopping Services - One thing I'm currenlty in the process of fixing is stopping an application on the server without stopping the entire system. I'm going to be using child_process for this. However, This will also add a communication layer between the server and an application.

That will be important for Silk to be lightweight - starting and stoping apps when needed instead of always having them running.

formula1 commented 10 years ago

The Common API

So, heres what we can do.

RTC

This is one of the things I'm going to do next because I think its interesting.

Server Connections API

This will be important at somepoint, however I also think it ties in strongly with security and ensuring apps don't conflict when it comes to port numbers. This may also be a new issue as well

Selector

I'm Opening up a new Issue for this