subscribe


Description:

public Result<EventBus,Error> subscribe (string topic, owned EventHandler handler)

Subscribes topic with handler.

Parameters:

topic

topic name.

handler

event handler.

Returns:

Result.ok(this bus), or Result.error(EventBusError.INVALID_ARGUMENT) when topic is empty.