Open graingert opened 6 years ago
I've got a functions:
def get_producer(): tool = Tool() async def start(listener): def on_event(event): listener(event) tool.on_scan_result = on_event tool.start_scan() await tool.transport.drain() async def stop(): tool.stop_scanning() await tool.transport.drain() return { "start": start, "stop": stop } # my old api. return AsyncObservable( # what goes here? )
And I'd like to be able to turn it into an observable stream, that automatically starts/stops scanning when the obserables are added/removed but I'm not sure how.
/cc @dbrattli
I've got a functions:
And I'd like to be able to turn it into an observable stream, that automatically starts/stops scanning when the obserables are added/removed but I'm not sure how.