Then, anywhere else in your application, you may lookup and make use of the service:
// far away in the code, maybe in a different file
SqlService sql := Service.find(SqlService#)
stmt := sql.sql("select foo from bar where baz is not null")
stmt.queryEach |row|
{
echo(row->foo)
}
brianMon 22 Mar 2010
All the web examples illustrate use of the WispService to launch a web server.
Akcelisto Mon 22 Mar 2010
Could anyone give me example for sys::Service?
tactics Mon 22 Mar 2010
I don't think we have any example code (maybe someone can throw something together for the
examples
directory?)It's not too hard, though.
sys::Service
is a mixin. I think the only current implementing class in the standard library issql::SqlService
.To use a service, you instantiate it and install it:
Then, anywhere else in your application, you may lookup and make use of the service:
brian Mon 22 Mar 2010
All the web examples illustrate use of the WispService to launch a web server.