{"action":"created","comment":{"url":"https://api.github.com/repos/pyacq/pyacq/pulls/comments/41398873","id":41398873,"diff_hunk":"@@ -0,0 +1,70 @@\n+from pyacq.core.stream  import OutputStream, InputStream\n+from pyacq.core.tools  import ThreadPollInput\n+from pyqtgraph.Qt import QtCore, QtGui\n+import pyqtgraph as pg\n+\n+import numpy as np\n+import weakref\n+import time\n+\n+\n+def test_ThreadPollInput():\n+    app = pg.mkQApp()\n+    \n+    nb_channel = 16\n+    chunksize = 1024\n+    stream_spec = dict(protocol = 'tcp', interface = '127.0.0.1', port='*', \n+                       transfermode = 'plaindata', streamtype = 'analogsignal',\n+                       dtype = 'float32', shape = (-1, nb_channel), compression ='',\n+                       scale = None, offset = None, units = '', timeaxis = 0)\n+    \n+    class ThreadSender(QtCore.QThread):\n+        def __init__(self, output_stream, parent = None):\n+            QtCore.QThread.__init__(self, parent)\n+            self.output_stream = weakref.ref(output_stream)","path":"pyacq/core/tests/test_tools.py","position":24,"original_position":24,"commit_id":"606a898b5e70e644cba937b2fc0e8ad96d9d2055","original_commit_id":"606a898b5e70e644cba937b2fc0e8ad96d9d2055","user":{"login":"campagnola","id":940580,"avatar_url":"https://avatars.githubusercontent.com/u/940580?v=3","gravatar_id":"","url":"https://api.github.com/users/campagnola","html_url":"https://github.com/campagnola","followers_url":"https://api.github.com/users/campagnola/followers","following_url":"https://api.github.com/users/campagnola/following{/other_user}","gists_url":"https://api.github.com/users/campagnola/gists{/gist_id}","starred_url":"https://api.github.com/users/campagnola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/campagnola/subscriptions","organizations_url":"https://api.github.com/users/campagnola/orgs","repos_url":"https://api.github.com/users/campagnola/repos","events_url":"https://api.github.com/users/campagnola/events{/privacy}","received_events_url":"https://api.github.com/users/campagnola/received_events","type":"User","site_admin":false},"body":"I think the zmq socket should belong to the thread that is reading it. Ideally the socket would be created in the same thread, but since that is sometimes difficult, a compromise would be to create the socket in one thread, pass it to the poller thread, and then delete the reference from the original thread, to avoid any possibility of touching the socket from the wrong thread.\r\n\r\nFor example: zmq sockets probably do some cleanup when they are collected. If this cleanup happens in one thread while the socket is being polled in another, then you might crash.","created_at":"2015-10-07T14:46:23Z","updated_at":"2015-10-07T14:46:23Z","html_url":"https://github.com/pyacq/pyacq/pull/19#discussion_r41398873","pull_request_url":"https://api.github.com/repos/pyacq/pyacq/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/pyacq/pyacq/pulls/comments/41398873"},"html":{"href":"https://github.com/pyacq/pyacq/pull/19#discussion_r41398873"},"pull_request":{"href":"https://api.github.com/repos/pyacq/pyacq/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/pyacq/pyacq/pulls/19","id":44213147,"html_url":"https://github.com/pyacq/pyacq/pull/19","diff_url":"https://github.com/pyacq/pyacq/pull/19.diff","patch_url":"https://github.com/pyacq/pyacq/pull/19.patch","issue_url":"https://api.github.com/repos/pyacq/pyacq/issues/19","number":19,"state":"open","locked":false,"title":"Device pyaudio","user":{"login":"samuelgarcia","id":815627,"avatar_url":"https://avatars.githubusercontent.com/u/815627?v=3","gravatar_id":"","url":"https://api.github.com/users/samuelgarcia","html_url":"https://github.com/samuelgarcia","followers_url":"https://api.github.com/users/samuelgarcia/followers","following_url":"https://api.github.com/users/samuelgarcia/following{/other_user}","gists_url":"https://api.github.com/users/samuelgarcia/gists{/gist_id}","starred_url":"https://api.github.com/users/samuelgarcia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuelgarcia/subscriptions","organizations_url":"https://api.github.com/users/samuelgarcia/orgs","repos_url":"https://api.github.com/users/samuelgarcia/repos","events_url":"https://api.github.com/users/samuelgarcia/events{/privacy}","received_events_url":"https://api.github.com/users/samuelgarcia/received_events","type":"User","site_admin":false},"body":"Simple PyAudio Node : grab and playback.","created_at":"2015-09-04T12:38:48Z","updated_at":"2015-10-07T14:46:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc320ba8326900ed05bd18fe9bc810c850222c18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pyacq/pyacq/pulls/19/commits","review_comments_url":"https://api.github.com/repos/pyacq/pyacq/pulls/19/comments","review_comment_url":"https://api.github.com/repos/pyacq/pyacq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pyacq/pyacq/issues/19/comments","statuses_url":"https://api.github.com/repos/pyacq/pyacq/statuses/606a898b5e70e644cba937b2fc0e8ad96d9d2055","head":{"label":"samuelgarcia:device-pyaudio","ref":"device-pyaudio","sha":"606a898b5e70e644cba937b2fc0e8ad96d9d2055","user":{"login":"samuelgarcia","id":815627,"avatar_url":"https://avatars.githubusercontent.com/u/815627?v=3","gravatar_id":"","url":"https://api.github.com/users/samuelgarcia","html_url":"https://github.com/samuelgarcia","followers_url":"https://api.github.com/users/samuelgarcia/followers","following_url":"https://api.github.com/users/samuelgarcia/following{/other_user}","gists_url":"https://api.github.com/users/samuelgarcia/gists{/gist_id}","starred_url":"https://api.github.com/users/samuelgarcia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuelgarcia/subscriptions","organizations_url":"https://api.github.com/users/samuelgarcia/orgs","repos_url":"https://api.github.com/users/samuelgarcia/repos","events_url":"https://api.github.com/users/samuelgarcia/events{/privacy}","received_events_url":"https://api.github.com/users/samuelgarcia/received_events","type":"User","site_admin":false},"repo":{"id":37719652,"name":"pyacq","full_name":"samuelgarcia/pyacq","owner":{"login":"samuelgarcia","id":815627,"avatar_url":"https://avatars.githubusercontent.com/u/815627?v=3","gravatar_id":"","url":"https://api.github.com/users/samuelgarcia","html_url":"https://github.com/samuelgarcia","followers_url":"https://api.github.com/users/samuelgarcia/followers","following_url":"https://api.github.com/users/samuelgarcia/following{/other_user}","gists_url":"https://api.github.com/users/samuelgarcia/gists{/gist_id}","starred_url":"https://api.github.com/users/samuelgarcia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuelgarcia/subscriptions","organizations_url":"https://api.github.com/users/samuelgarcia/orgs","repos_url":"https://api.github.com/users/samuelgarcia/repos","events_url":"https://api.github.com/users/samuelgarcia/events{/privacy}","received_events_url":"https://api.github.com/users/samuelgarcia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/samuelgarcia/pyacq","description":"Simple Framework for data acquisition (signal, video) in pure python.","fork":true,"url":"https://api.github.com/repos/samuelgarcia/pyacq","forks_url":"https://api.github.com/repos/samuelgarcia/pyacq/forks","keys_url":"https://api.github.com/repos/samuelgarcia/pyacq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samuelgarcia/pyacq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samuelgarcia/pyacq/teams","hooks_url":"https://api.github.com/repos/samuelgarcia/pyacq/hooks","issue_events_url":"https://api.github.com/repos/samuelgarcia/pyacq/issues/events{/number}","events_url":"https://api.github.com/repos/samuelgarcia/pyacq/events","assignees_url":"https://api.github.com/repos/samuelgarcia/pyacq/assignees{/user}","branches_url":"https://api.github.com/repos/samuelgarcia/pyacq/branches{/branch}","tags_url":"https://api.github.com/repos/samuelgarcia/pyacq/tags","blobs_url":"https://api.github.com/repos/samuelgarcia/pyacq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samuelgarcia/pyacq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samuelgarcia/pyacq/git/refs{/sha}","trees_url":"https://api.github.com/repos/samuelgarcia/pyacq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samuelgarcia/pyacq/statuses/{sha}","languages_url":"https://api.github.com/repos/samuelgarcia/pyacq/languages","stargazers_url":"https://api.github.com/repos/samuelgarcia/pyacq/stargazers","contributors_url":"https://api.github.com/repos/samuelgarcia/pyacq/contributors","subscribers_url":"https://api.github.com/repos/samuelgarcia/pyacq/subscribers","subscription_url":"https://api.github.com/repos/samuelgarcia/pyacq/subscription","commits_url":"https://api.github.com/repos/samuelgarcia/pyacq/commits{/sha}","git_commits_url":"https://api.github.com/repos/samuelgarcia/pyacq/git/commits{/sha}","comments_url":"https://api.github.com/repos/samuelgarcia/pyacq/comments{/number}","issue_comment_url":"https://api.github.com/repos/samuelgarcia/pyacq/issues/comments{/number}","contents_url":"https://api.github.com/repos/samuelgarcia/pyacq/contents/{+path}","compare_url":"https://api.github.com/repos/samuelgarcia/pyacq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samuelgarcia/pyacq/merges","archive_url":"https://api.github.com/repos/samuelgarcia/pyacq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samuelgarcia/pyacq/downloads","issues_url":"https://api.github.com/repos/samuelgarcia/pyacq/issues{/number}","pulls_url":"https://api.github.com/repos/samuelgarcia/pyacq/pulls{/number}","milestones_url":"https://api.github.com/repos/samuelgarcia/pyacq/milestones{/number}","notifications_url":"https://api.github.com/repos/samuelgarcia/pyacq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samuelgarcia/pyacq/labels{/name}","releases_url":"https://api.github.com/repos/samuelgarcia/pyacq/releases{/id}","created_at":"2015-06-19T12:07:23Z","updated_at":"2015-06-19T12:07:25Z","pushed_at":"2015-10-06T08:23:51Z","git_url":"git://github.com/samuelgarcia/pyacq.git","ssh_url":"git@github.com:samuelgarcia/pyacq.git","clone_url":"https://github.com/samuelgarcia/pyacq.git","svn_url":"https://github.com/samuelgarcia/pyacq","homepage":null,"size":881,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pyacq:master","ref":"master","sha":"e6d99c390f4cafb21c73139c0243b6f24cc8ffb6","user":{"login":"pyacq","id":12966382,"avatar_url":"https://avatars.githubusercontent.com/u/12966382?v=3","gravatar_id":"","url":"https://api.github.com/users/pyacq","html_url":"https://github.com/pyacq","followers_url":"https://api.github.com/users/pyacq/followers","following_url":"https://api.github.com/users/pyacq/following{/other_user}","gists_url":"https://api.github.com/users/pyacq/gists{/gist_id}","starred_url":"https://api.github.com/users/pyacq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyacq/subscriptions","organizations_url":"https://api.github.com/users/pyacq/orgs","repos_url":"https://api.github.com/users/pyacq/repos","events_url":"https://api.github.com/users/pyacq/events{/privacy}","received_events_url":"https://api.github.com/users/pyacq/received_events","type":"Organization","site_admin":false},"repo":{"id":11476863,"name":"pyacq","full_name":"pyacq/pyacq","owner":{"login":"pyacq","id":12966382,"avatar_url":"https://avatars.githubusercontent.com/u/12966382?v=3","gravatar_id":"","url":"https://api.github.com/users/pyacq","html_url":"https://github.com/pyacq","followers_url":"https://api.github.com/users/pyacq/followers","following_url":"https://api.github.com/users/pyacq/following{/other_user}","gists_url":"https://api.github.com/users/pyacq/gists{/gist_id}","starred_url":"https://api.github.com/users/pyacq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyacq/subscriptions","organizations_url":"https://api.github.com/users/pyacq/orgs","repos_url":"https://api.github.com/users/pyacq/repos","events_url":"https://api.github.com/users/pyacq/events{/privacy}","received_events_url":"https://api.github.com/users/pyacq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pyacq/pyacq","description":"Simple Framework for data acquisition (signal, video) in pure python.","fork":false,"url":"https://api.github.com/repos/pyacq/pyacq","forks_url":"https://api.github.com/repos/pyacq/pyacq/forks","keys_url":"https://api.github.com/repos/pyacq/pyacq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pyacq/pyacq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pyacq/pyacq/teams","hooks_url":"https://api.github.com/repos/pyacq/pyacq/hooks","issue_events_url":"https://api.github.com/repos/pyacq/pyacq/issues/events{/number}","events_url":"https://api.github.com/repos/pyacq/pyacq/events","assignees_url":"https://api.github.com/repos/pyacq/pyacq/assignees{/user}","branches_url":"https://api.github.com/repos/pyacq/pyacq/branches{/branch}","tags_url":"https://api.github.com/repos/pyacq/pyacq/tags","blobs_url":"https://api.github.com/repos/pyacq/pyacq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pyacq/pyacq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pyacq/pyacq/git/refs{/sha}","trees_url":"https://api.github.com/repos/pyacq/pyacq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pyacq/pyacq/statuses/{sha}","languages_url":"https://api.github.com/repos/pyacq/pyacq/languages","stargazers_url":"https://api.github.com/repos/pyacq/pyacq/stargazers","contributors_url":"https://api.github.com/repos/pyacq/pyacq/contributors","subscribers_url":"https://api.github.com/repos/pyacq/pyacq/subscribers","subscription_url":"https://api.github.com/repos/pyacq/pyacq/subscription","commits_url":"https://api.github.com/repos/pyacq/pyacq/commits{/sha}","git_commits_url":"https://api.github.com/repos/pyacq/pyacq/git/commits{/sha}","comments_url":"https://api.github.com/repos/pyacq/pyacq/comments{/number}","issue_comment_url":"https://api.github.com/repos/pyacq/pyacq/issues/comments{/number}","contents_url":"https://api.github.com/repos/pyacq/pyacq/contents/{+path}","compare_url":"https://api.github.com/repos/pyacq/pyacq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pyacq/pyacq/merges","archive_url":"https://api.github.com/repos/pyacq/pyacq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pyacq/pyacq/downloads","issues_url":"https://api.github.com/repos/pyacq/pyacq/issues{/number}","pulls_url":"https://api.github.com/repos/pyacq/pyacq/pulls{/number}","milestones_url":"https://api.github.com/repos/pyacq/pyacq/milestones{/number}","notifications_url":"https://api.github.com/repos/pyacq/pyacq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pyacq/pyacq/labels{/name}","releases_url":"https://api.github.com/repos/pyacq/pyacq/releases{/id}","created_at":"2013-07-17T13:38:28Z","updated_at":"2015-06-19T12:06:51Z","pushed_at":"2015-10-06T08:23:51Z","git_url":"git://github.com/pyacq/pyacq.git","ssh_url":"git@github.com:pyacq/pyacq.git","clone_url":"https://github.com/pyacq/pyacq.git","svn_url":"https://github.com/pyacq/pyacq","homepage":null,"size":1258,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":6,"forks":6,"open_issues":6,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pyacq/pyacq/pulls/19"},"html":{"href":"https://github.com/pyacq/pyacq/pull/19"},"issue":{"href":"https://api.github.com/repos/pyacq/pyacq/issues/19"},"comments":{"href":"https://api.github.com/repos/pyacq/pyacq/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/pyacq/pyacq/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/pyacq/pyacq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pyacq/pyacq/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/pyacq/pyacq/statuses/606a898b5e70e644cba937b2fc0e8ad96d9d2055"}}}}