#387: Services as methods
------------------------+---------------------------------------------------
Reporter: mrpingouin | Owner: admin
Type: Feature | Status: new
Priority: 1 | Milestone:
Component: Liquidsoap | Version:
Keywords: | Mac: 1
Linux: 1 | Netbsd: 1
Other: 1 | Freebsd: 1
------------------------+---------------------------------------------------
I'm considering an object-oriented extension of our scripting language
that would allow a nice integration of services (server commands) as
methods. It would make it possible for users to redefine methods, define
their own. Also, it would bring some structure to services, ensuring that
they are printed in a uniform way. Finally, it brings recursivity (through
self) that was needed in some cases:
{{{
def live =
# dummy init, an option type would be nice...
o = ref blank()
extend input.harbor("/mount") with
method on_connect() =
o := output.file(%vorbis,"backup.ogg",self)
end
method on_disconnect() =
source.shutdown(!o)
end
end
end
}}}
It doesn't seem too hard to do (except for migrating all existing server
code) but I need to make sure how to handle the recursive types that can
arise.
There are a couple questions:
* Do we still reference sources by their ID in the server? It's not
always possible to reference them through variable names.
* How much of the API do we change? Is (!o)#shutdown preferable to
source.shutdown(!o)? Should all event handlers become methods?
* How will we print those huge types?
--
Ticket URL: <http://savonet.rastageeks.org/ticket/387>
Savonet <http://savonet.rastageeks.org/>
Let's program our stream !
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Savonet-trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-trac