Services are used to implement inter-plugin communication, and are registered with implementService().

Services can only be called after all plugins have been loaded.

function O.service(name, arg1, arg2, …)

Call the registered service called name. Further arguments are optional, and if given, will be passed to the service function.

If more than one service function is registered, they will all be called in the order of registration until one of the functions returns a value which is not undefined.

An exception will be thrown if no service function is registered for this name.

O.service() returns the value returned from service function.

function O.serviceMaybe(name, arg1, arg2, …)

Like O.service(), except undefined is returned if no service function is registered.

function O.serviceImplemented(name)

Returns true if there is at least one function registered to implement a service called name.