Added ability to define a parsing function for data before being copied to the main thread.