I was trying to incorporate GitHub - ReactiveX/RxPY: ReactiveX for Python in frappe custom API call.
I have a list of inputs and those could be executed in parallel.
Sample code snippet
return rx.from_iterable([list of items]).pipe( ops.map(lambda x: test(x)), ops.subscribe_on(scheduler) ).run()
What happens is that in the test method, I am not able to reference frappe.db.sql or frappe.get_doc or frappe.qb.from_.
It seems to me that the context is lost because the test method runs in a different thread.
Is there a workaround possible with this ?