{"action":"created","issue":{"url":"https://api.github.com/repos/potentialventures/cocotb/issues/618","repository_url":"https://api.github.com/repos/potentialventures/cocotb","labels_url":"https://api.github.com/repos/potentialventures/cocotb/issues/618/labels{/name}","comments_url":"https://api.github.com/repos/potentialventures/cocotb/issues/618/comments","events_url":"https://api.github.com/repos/potentialventures/cocotb/issues/618/events","html_url":"https://github.com/potentialventures/cocotb/pull/618","id":325060094,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg5NDg4NzA3","number":618,"title":"Allow the scheduler to handle yielding a list of coroutines and triggers","user":{"login":"TC01","id":1669136,"node_id":"MDQ6VXNlcjE2NjkxMzY=","avatar_url":"https://avatars3.githubusercontent.com/u/1669136?v=4","gravatar_id":"","url":"https://api.github.com/users/TC01","html_url":"https://github.com/TC01","followers_url":"https://api.github.com/users/TC01/followers","following_url":"https://api.github.com/users/TC01/following{/other_user}","gists_url":"https://api.github.com/users/TC01/gists{/gist_id}","starred_url":"https://api.github.com/users/TC01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TC01/subscriptions","organizations_url":"https://api.github.com/users/TC01/orgs","repos_url":"https://api.github.com/users/TC01/repos","events_url":"https://api.github.com/users/TC01/events{/privacy}","received_events_url":"https://api.github.com/users/TC01/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-21T21:08:20Z","updated_at":"2018-12-07T15:30:03Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/potentialventures/cocotb/pulls/618","html_url":"https://github.com/potentialventures/cocotb/pull/618","diff_url":"https://github.com/potentialventures/cocotb/pull/618.diff","patch_url":"https://github.com/potentialventures/cocotb/pull/618.patch"},"body":"Currently the cocotb scheduler understands how to yield a coroutine from another coroutine; it queues it and calls .join() automatically. It also understands how to yield a list of triggers and resume execution when the first one finishes.\r\n\r\nBut it does not understand how to yield a list of triggers and coroutines (or just coroutines); it will complain if the list contains anything that's not a trigger.\r\n\r\nThis commit fixes it so that if the scheduler encounters a list, it will iterate through that list and build a new one, calling ```.join()``` automatically on any objects of type RunningCoroutine. If the list contains something that was not a trigger or coroutine, it is dropped.\r\n\r\nThen the size of the new and old lists are compared; if they differ it means that the list contained something that was not a trigger or a coroutine, and so we do nothing. Otherwise we yield it.\r\n\r\nThe commit also includes a very minimal test for this functionality.\r\n\r\nThis resolves issue #588."},"comment":{"url":"https://api.github.com/repos/potentialventures/cocotb/issues/comments/445267849","html_url":"https://github.com/potentialventures/cocotb/pull/618#issuecomment-445267849","issue_url":"https://api.github.com/repos/potentialventures/cocotb/issues/618","id":445267849,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NTI2Nzg0OQ==","user":{"login":"imphil","id":1467123,"node_id":"MDQ6VXNlcjE0NjcxMjM=","avatar_url":"https://avatars1.githubusercontent.com/u/1467123?v=4","gravatar_id":"","url":"https://api.github.com/users/imphil","html_url":"https://github.com/imphil","followers_url":"https://api.github.com/users/imphil/followers","following_url":"https://api.github.com/users/imphil/following{/other_user}","gists_url":"https://api.github.com/users/imphil/gists{/gist_id}","starred_url":"https://api.github.com/users/imphil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imphil/subscriptions","organizations_url":"https://api.github.com/users/imphil/orgs","repos_url":"https://api.github.com/users/imphil/repos","events_url":"https://api.github.com/users/imphil/events{/privacy}","received_events_url":"https://api.github.com/users/imphil/received_events","type":"User","site_admin":false},"created_at":"2018-12-07T15:30:03Z","updated_at":"2018-12-07T15:30:03Z","author_association":"COLLABORATOR","body":"@TC01 thanks for this. Would you mind rebasing this PR on top of the current master to resolve the merge conflicts? Also it would be nice if you could add documentation describing this functionality, so people know what's expected to work (and what is not)."}}
{"actor":{"display_login":"imphil"}}