def bar_synchronous(loop, client): for i in range(10): widget = make_widget_synchronous() loop.call_soon_threadsafe(client.append_widget, 'bar', widget) loop.call_soon_threadsafe(client.log, 'Made widget {} in another thread'.format(i))
def bar_synchronous(): widgets = [] for i in range(12): widget = make_widget_synchronous() widgets.append(widget) return widgets