

def start_listening(self, request, event_handler, decode_add_listener, key=None):
    if key:
        partition_id = self._client.partition_service.get_partition_id(key)
        invocation = ListenerInvocation(request, event_handler, decode_add_listener, partition_id=partition_id)
    else:
        invocation = ListenerInvocation(request, event_handler, decode_add_listener)
    future = self._client.invoker.invoke(invocation)
    registration_id = decode_add_listener(future.result())
    invocation.registration_id = registration_id
    self.registrations[registration_id] = (registration_id, request.get_correlation_id())
    return registration_id

dataset/ETHPy150Open hazelcast/hazelcast-python-client/hazelcast/invocation.py ListenerService.start_listening/original