{"action":"created","issue":{"url":"https://api.github.com/repos/dabeaz/curio/issues/235","repository_url":"https://api.github.com/repos/dabeaz/curio","labels_url":"https://api.github.com/repos/dabeaz/curio/issues/235/labels{/name}","comments_url":"https://api.github.com/repos/dabeaz/curio/issues/235/comments","events_url":"https://api.github.com/repos/dabeaz/curio/issues/235/events","html_url":"https://github.com/dabeaz/curio/issues/235","id":274698810,"number":235,"title":"Spawning multiple blocking functions concurrently","user":{"login":"smarlowucf","id":8006658,"avatar_url":"https://avatars1.githubusercontent.com/u/8006658?v=4","gravatar_id":"","url":"https://api.github.com/users/smarlowucf","html_url":"https://github.com/smarlowucf","followers_url":"https://api.github.com/users/smarlowucf/followers","following_url":"https://api.github.com/users/smarlowucf/following{/other_user}","gists_url":"https://api.github.com/users/smarlowucf/gists{/gist_id}","starred_url":"https://api.github.com/users/smarlowucf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarlowucf/subscriptions","organizations_url":"https://api.github.com/users/smarlowucf/orgs","repos_url":"https://api.github.com/users/smarlowucf/repos","events_url":"https://api.github.com/users/smarlowucf/events{/privacy}","received_events_url":"https://api.github.com/users/smarlowucf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-11-16T23:20:28Z","updated_at":"2017-11-16T23:59:19Z","closed_at":"2017-11-16T23:59:19Z","author_association":"NONE","body":"This is more a question than an issue but I was curious if there's a better way with Curio to spawn multiple blocking functions?\r\n\r\nFor example:\r\n\r\n```\r\nimport curio\r\n\r\n\r\ndef fib(n):\r\n    if n < 2:\r\n        return 1\r\n\r\n    fib = 1\r\n    prev = 1\r\n    for i in range(2, n):\r\n        prev, fib = fib, fib + prev\r\n\r\n\r\nasync def async_fib(i):\r\n    await curio.run_in_process(fib, i)\r\n\r\n\r\nasync def main():\r\n    tasks = []\r\n    for i in range(10000, 11000):\r\n        task = await curio.spawn(async_fib, i)\r\n        tasks.append(task)\r\n\r\n    for task in tasks:\r\n        await task.join()\r\n\r\ncurio.run(main)\r\n```\r\n\r\nHad to use the extra `async_fib` coroutine to make it run concurrently."},"comment":{"url":"https://api.github.com/repos/dabeaz/curio/issues/comments/345102302","html_url":"https://github.com/dabeaz/curio/issues/235#issuecomment-345102302","issue_url":"https://api.github.com/repos/dabeaz/curio/issues/235","id":345102302,"user":{"login":"smarlowucf","id":8006658,"avatar_url":"https://avatars1.githubusercontent.com/u/8006658?v=4","gravatar_id":"","url":"https://api.github.com/users/smarlowucf","html_url":"https://github.com/smarlowucf","followers_url":"https://api.github.com/users/smarlowucf/followers","following_url":"https://api.github.com/users/smarlowucf/following{/other_user}","gists_url":"https://api.github.com/users/smarlowucf/gists{/gist_id}","starred_url":"https://api.github.com/users/smarlowucf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarlowucf/subscriptions","organizations_url":"https://api.github.com/users/smarlowucf/orgs","repos_url":"https://api.github.com/users/smarlowucf/repos","events_url":"https://api.github.com/users/smarlowucf/events{/privacy}","received_events_url":"https://api.github.com/users/smarlowucf/received_events","type":"User","site_admin":false},"created_at":"2017-11-16T23:59:19Z","updated_at":"2017-11-16T23:59:19Z","author_association":"NONE","body":"Aha, yep. That does it. Thanks!"}}
{"actor":{"display_login":"smarlowucf"}}