def handle(client_message, handle_event_partition_lost=None, to_object=None):
message_type = client_message.get_message_type()<EOL>if message_type == EVENT_PARTITIONLOST and handle_event_partition_lost is not None:<EOL><INDENT>partition_id = client_message.read_int()<EOL>lost_backup_count = client_message.read_int()<EOL>source = None<EOL>if not client_message.read_bool():<EOL><INDENT>source = AddressCodec.decode(client_message, to_object)<EOL><DEDENT>handle_event_partition_lost(partition_id=partition_id, lost_backup_count=lost_backup_count, source=source)<EOL><DEDENT>
Event handler