- Package Name: azure-eventhub
- Package Version: 5.2.0
- Operating System: Ubuntu 20.04
- Python Version: 3.8
Describe the bug
Object EventData is not pickeable, thus it is not possible to process them in a process pool.
To Reproduce
Steps to reproduce the behavior:
from multiprocessing import Pool
from typing import List
from azure.eventhub import EventData
def build_event_data(i):
return EventData(body=f'{i}')
if __name__ == "__main__":
with Pool() as p:
eventdata : List[EventData] = p.map(build_event_data,[(i) for i in range(10)])
Expected behavior
It's expected that eventdata holds a list of all events created in parallel.
Exception Raised
multiprocessing.pool.MaybeEncodingError: Error sending result: '[EventData(body='0', properties={}, offset=None, sequence_number=None, partition_key=None, enqueued_time=None)]'. Reason: 'TypeError('no default __reduce__ due to non-trivial __cinit__')'
Describe the bug
Object
EventDatais not pickeable, thus it is not possible to process them in a process pool.To Reproduce
Steps to reproduce the behavior:
Expected behavior
It's expected that
eventdataholds a list of all events created in parallel.Exception Raised