Hi all!

On Fri, Jan 28, 2011 at 9:48 AM, David Baelde <[email protected]> wrote:
> Also note that Romain added
> some features recently to define HTTP services directly in liquidsoap.

Just a few comments on that part. The need to a machine-oriented API
for communicating with liquidsoap has been highlighted many times and
I have always been a strong supporter of that.

That said, my point about how to implement that properly in liquidsoap
has evolved recently. I initialy though about having an option to
change telnet's outptut to spit out JSON data instead of
human-oriented replies.

I am not sure how this is appropriate now. For one thing, it requires
a lot of work in the code and I am lazy/it is bug-prone.
But the most important is that, following the usual philosophy for
liquidsoap, we tend to look for the most general solution first,
something that will give the user the ability to shape it to its own
need.

Thus, we have recently introduced the following functionalities:
 * All language values can be exported in JSON using json_of
 * Users can register their own HTTP handlers for GET and POST requests
These two elementary bricks seem much more appropriate for me.
For one thing telnet is not a communication protocol that should be
used over the internet (not secure) and HTTP is the most used
protocol, with tons of high-level APIs in any reasonable language.
Secondly, these allow the user to really build their own commands.

Now there are still at least 3 things that can be done:
 a) Have a way to receive JSON values. This is not easy because of our
static typing system but we could think about something
 b) Identify the basic bricks that are needed to implement each
existing telnet function and expose them in the scripting language.
For instance, source.skip exists but some request-related things such
as request.trace do not yet
 c) Write wrapper around those basic bricks that define standard and
simple JSON functions, therefore acheiving "simple things should be
simple but complex things should be possible"

Points a) and b) are more devs tasks but for point c) we clearly rely
on our beloved users. Telling us what kind of commands they want or,
better, have implemented would help us to incorporate them in the
standard library and make sure its appropriate for our users.

Finally, an initial documentation about how to use HTTP with JSON is
available there:
  http://savonet.sourceforge.net/doc-svn/harbor_http.html

Don't hesitate to continue the discussion about JSON APIs that you
would be interested in, either in this thread or in a new one if
necessary..

Take care yall!
Romain

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to