[Ur] info page containing sensor information ?
Marc Weber
marco-oweber at gmx.de
Fri Dec 3 04:18:43 EST 2010
Let's say I'd like to create an info page which lists various items such
as:
- disk space
- current heap size used by urweb
- memory allocated by embedded ruby interpreter (doesn't exist yet)
How would to design a such an interface which allows multiple libraries
to add their own pieces of information?
In Scala it would be easy:
object ListOfInformationProviders {
val list: ListBuilder()
def add(provider){ list.add(provide0 }
def allKeys() = {
... query all providers and return map or such
}
}
external ruby code doesn't have to change core code:
object RubyInformationProviders {
ListOfInformationProviders.add(this); // register self as information provider
}
Is there a way to model this in Ur as well?
Marc Weber
More information about the Ur
mailing list