Devtools relationship to cs.kobj.net


#1

A student recently ask,
What is the relationship between cs.kobj.net and http://devtools.picolabs.io/? Why is it that the Kynetx Event Console has to be pointed at cs.kobj.net instead of http://devtools.picolabs.io/? Shouldn’t it be pointed at http://devtools.picolabs.io/ since that’s where the rules are installed?

Also, where do channels fit in? They seem super ambiguous to me. Isn’t an http request enough to communicate than an event was fired?


#2

KRL rules are evaluated by an event engine on certain events, to change the state of a pico. channels are the means of communication for picos, similar to ports on a network connection.
cs.kobj.net is a KRL event engine. devtools extends the functionality of the event engine to simplify the management of picos.
When you raise an event you raise the event to the event engine with a identifier that routes that event to a certain pico. the routing identifier is a “channel”, I think of it as an event bus.

Devtools has code to raise events to the event engine, but sending them directly to cs.kobj.net is exactly what happens with devtools.

channels gives picos the ability to be dynamic, you can create as many as you want, filter events based on what channel they came in on, and delete compromised channels. Channels also provide a means for communications between Picos. An http request could be enough with added parameters, but the added parameters would be identifiers for the Pico observing the event. Channels are the designed Identifiers used to route events to Picos.


#3

Don’t confuse the developer application (devtools.picolabs,io) with the engine that runs picos (cs.kobj.net). Think of the first as an IDE of sorts while, in that analogy, the engine is like the CPU.

Devtools is a single-page application (SPA) written in JavaScript that uses the engine to make things happen. Open your browser console and you’ll see it’s making lots of calls to cs.kobj.net.

Look at the code for Devtools and you’ll see it’s just a bunch of javascript that runs in your browser. There’s no server there at all other than Github itself (we’re using Github pages to host the Website that consitutes the SPA)