_createEvent(eventDef, name) {
		let event;
		if (isFunction(eventDef) || Array.isArray(eventDef)) {
			event = {
				handler: eventDef
			};
		} else if (isObject(eventDef)) {
			event = _.cloneDeep(eventDef);
		} else {
			throw new ServiceSchemaError(
				`Invalid event definition in '${name}' event in '${this.fullName}' service!`
			);
		}

		if (!isFunction(event.handler) && !Array.isArray(event.handler)) {
			throw new ServiceSchemaError(
				`Missing event handler on '${name}' event in '${this.fullName}' service!`
			);
		}

		// Detect new or legacy parameter list of event handler
		// Legacy: handler(payload, sender, eventName)
		// New: handler(ctx)
		let handler;
		if (isFunction(event.handler)) {
			const args = functionArguments(event.handler);
			handler = this.Promise.method(event.handler);
			handler.__newSignature = event.context === true || isNewSignature(args);
		} else if (Array.isArray(event.handler)) {
			handler = event.handler.map(h => {
				const args = functionArguments(h);
				h = this.Promise.method(h);
				h.__newSignature = event.context === true || isNewSignature(args);
				return h;
			});
		}

		if (!event.name) event.name = name;

		event.service = this;
		const self = this;
		if (isFunction(handler)) {
			// Call single handler
			event.handler = function (ctx) {
				return handler.apply(
					self,
					handler.__newSignature ? [ctx] : [ctx.params, ctx.nodeID, ctx.eventName, ctx]
				);
			};
		} else if (Array.isArray(handler)) {
			// Call multiple handler
			event.handler = function (ctx) {
				return self.Promise.all(
					handler.map(fn =>
						fn.apply(
							self,
							fn.__newSignature ? [ctx] : [ctx.params, ctx.nodeID, ctx.eventName, ctx]
						)
					)
				);
			};
		}

		return event;
	}
Create an event subscription for broker

@param {Object|Function} eventDef
@param {String} name
@returns {Object}

@private
@memberof Service