public function subscribe($pattern, $object, $method)
{
if (!(is_object($object) && is_string($method))) {
throw new InvalidInputException();
}
$callable = array($object, $method);
$key = $this->prefix . $pattern;
if (array_key_exists($key, $this->callbacks)) {
$this->callbacks[$key][] = $callable;
} else {
$this->callbacks[$key] = array($callable);
}
$this->send(\Erlang\term_to_binary(array(new \Erlang\OtpErlangAtom('subscribe'), $pattern)));
}