docs: function create_tcn_listener(events, when) {
  
  	debug.assert(events).is('object');
  	debug.assert(when).is('object');
  
  	// Normalize event object back to event name
  	var when_str = NoPg.stringifyEventName(when);
  
  	return function tcn_listener(payload) {
  		payload = NoPg.parseTCNPayload(payload);
  		var event = tcn_event_mapping[''+payload.table+','+payload.op];
  
  		if(!event) {
  			debug.warn('Could not find event name for payload: ', payload);
  			return;
  		}
  
  		// Verify we don't emit, if matching id enabled and does not match
  		if( when.hasOwnProperty('id') && (payload.keys.id !== when.id) ) {
  			return;
  		}
  
  		// Verify we don't emit, if matching event name enabled and does not match
  		if( when.hasOwnProperty('name') && (event !== when.name) ) {
  			return;
  		}
  
  		events.emit(when_str, payload.keys.id, event, when.type);
  	};
  }