onInvoke method
sets the invocation handler, if an error is thrown within the handler this method will result an error message to the transport or router respectively
Implementation
void onInvoke(FutureOr<void> Function(Invocation invocation) onInvoke) {
_onInvoke = onInvoke;
_attachStreamInvocationHandlerIfNeeded();
}