{"action":"created","comment":{"url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls/comments/46260400","id":46260400,"diff_hunk":"@@ -180,18 +217,42 @@ class CassandraReadJournalIntegrationSpec extends TestKit(ActorSystem(\"test\", co\n         received.expectMsgType[EventEnvelope]\n         received.expectMsgType[EventEnvelope]\n         Thread.sleep(6000) // poll interval + 1\n-        \n-        system.stop(doc)\n-        journal.shutdown().futureValue        \n       }\n+    }\n \n-      /*\n-      \"discover real-time events as they are added, across partition boundaries\" in {\n-        pending\n+    \"answering a query with offset\" should {\n+      \"return only events from time windows at or after the offset\" in fixture { f =>\n+        import f._\n+        \n+        def send(i:Int) = { \n+          doc ! s\"change-$i\"\n+          probe.expectMsgType[String] // we know it's persisted once it hits the probe          \n+        }\n+        \n+        send(1)\n+        Thread.sleep(1000) // time window is 1 second\n+        send(2)\n+        Thread.sleep(1000) // time window is 1 second\n+        send(3)\n+        Thread.sleep(1000) // time window is 1 second\n+        send(4)\n+        val offset = System.currentTimeMillis()","path":"src/test/scala/akka/persistence/cassandra/query/CassandraReadJournalIntegrationSpec.scala","position":183,"original_position":183,"commit_id":"100b52abdef2c26c8f6239adff1fe5473b0aed26","original_commit_id":"100b52abdef2c26c8f6239adff1fe5473b0aed26","user":{"login":"tom-williams","id":1475331,"avatar_url":"https://avatars.githubusercontent.com/u/1475331?v=3","gravatar_id":"","url":"https://api.github.com/users/tom-williams","html_url":"https://github.com/tom-williams","followers_url":"https://api.github.com/users/tom-williams/followers","following_url":"https://api.github.com/users/tom-williams/following{/other_user}","gists_url":"https://api.github.com/users/tom-williams/gists{/gist_id}","starred_url":"https://api.github.com/users/tom-williams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tom-williams/subscriptions","organizations_url":"https://api.github.com/users/tom-williams/orgs","repos_url":"https://api.github.com/users/tom-williams/repos","events_url":"https://api.github.com/users/tom-williams/events{/privacy}","received_events_url":"https://api.github.com/users/tom-williams/received_events","type":"User","site_admin":false},"body":"Would it not make more sense to move this line to before `send(4)` ?\r\nIf the method send takes more time than the time window, then isn't there a chance that it will not be the first event seen?","created_at":"2015-12-01T10:12:54Z","updated_at":"2015-12-01T10:12:54Z","html_url":"https://github.com/jypma/akka-persistence-cassandra-query/pull/5#discussion_r46260400","pull_request_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls/comments/46260400"},"html":{"href":"https://github.com/jypma/akka-persistence-cassandra-query/pull/5#discussion_r46260400"},"pull_request":{"href":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls/5","id":51057422,"html_url":"https://github.com/jypma/akka-persistence-cassandra-query/pull/5","diff_url":"https://github.com/jypma/akka-persistence-cassandra-query/pull/5.diff","patch_url":"https://github.com/jypma/akka-persistence-cassandra-query/pull/5.patch","issue_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/issues/5","number":5,"state":"open","locked":false,"title":"Return events in time window order","user":{"login":"jypma","id":483519,"avatar_url":"https://avatars.githubusercontent.com/u/483519?v=3","gravatar_id":"","url":"https://api.github.com/users/jypma","html_url":"https://github.com/jypma","followers_url":"https://api.github.com/users/jypma/followers","following_url":"https://api.github.com/users/jypma/following{/other_user}","gists_url":"https://api.github.com/users/jypma/gists{/gist_id}","starred_url":"https://api.github.com/users/jypma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jypma/subscriptions","organizations_url":"https://api.github.com/users/jypma/orgs","repos_url":"https://api.github.com/users/jypma/repos","events_url":"https://api.github.com/users/jypma/events{/privacy}","received_events_url":"https://api.github.com/users/jypma/received_events","type":"User","site_admin":false},"body":"Implementation runs a query per persistenceId per time window, and stops reading once the event's time is no longer in the time window. A future optimization might keep N open queries around,  resuming them as time windows progress.\r\n\r\n@tom-williams @domask please review.\r\n\r\nRequires https://github.com/jypma/akka-persistence-cassandra/pull/1 to know the actual length of time windows.","created_at":"2015-11-18T08:58:01Z","updated_at":"2015-12-01T10:12:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bbc794ed2021425e041e898103a6917141b06db9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls/5/commits","review_comments_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls/5/comments","review_comment_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/issues/5/comments","statuses_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/statuses/100b52abdef2c26c8f6239adff1fe5473b0aed26","head":{"label":"jypma:chrono_time_windows","ref":"chrono_time_windows","sha":"100b52abdef2c26c8f6239adff1fe5473b0aed26","user":{"login":"jypma","id":483519,"avatar_url":"https://avatars.githubusercontent.com/u/483519?v=3","gravatar_id":"","url":"https://api.github.com/users/jypma","html_url":"https://github.com/jypma","followers_url":"https://api.github.com/users/jypma/followers","following_url":"https://api.github.com/users/jypma/following{/other_user}","gists_url":"https://api.github.com/users/jypma/gists{/gist_id}","starred_url":"https://api.github.com/users/jypma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jypma/subscriptions","organizations_url":"https://api.github.com/users/jypma/orgs","repos_url":"https://api.github.com/users/jypma/repos","events_url":"https://api.github.com/users/jypma/events{/privacy}","received_events_url":"https://api.github.com/users/jypma/received_events","type":"User","site_admin":false},"repo":{"id":43485121,"name":"akka-persistence-cassandra-query","full_name":"jypma/akka-persistence-cassandra-query","owner":{"login":"jypma","id":483519,"avatar_url":"https://avatars.githubusercontent.com/u/483519?v=3","gravatar_id":"","url":"https://api.github.com/users/jypma","html_url":"https://github.com/jypma","followers_url":"https://api.github.com/users/jypma/followers","following_url":"https://api.github.com/users/jypma/following{/other_user}","gists_url":"https://api.github.com/users/jypma/gists{/gist_id}","starred_url":"https://api.github.com/users/jypma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jypma/subscriptions","organizations_url":"https://api.github.com/users/jypma/orgs","repos_url":"https://api.github.com/users/jypma/repos","events_url":"https://api.github.com/users/jypma/events{/privacy}","received_events_url":"https://api.github.com/users/jypma/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jypma/akka-persistence-cassandra-query","description":"Query plugin implementation for akka-persistence-cassandra","fork":false,"url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query","forks_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/forks","keys_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/teams","hooks_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/hooks","issue_events_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/issues/events{/number}","events_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/events","assignees_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/assignees{/user}","branches_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/branches{/branch}","tags_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/tags","blobs_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/git/refs{/sha}","trees_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/statuses/{sha}","languages_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/languages","stargazers_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/stargazers","contributors_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/contributors","subscribers_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/subscribers","subscription_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/subscription","commits_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/commits{/sha}","git_commits_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/git/commits{/sha}","comments_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/comments{/number}","issue_comment_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/issues/comments{/number}","contents_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/contents/{+path}","compare_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/merges","archive_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/downloads","issues_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/issues{/number}","pulls_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls{/number}","milestones_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/milestones{/number}","notifications_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/labels{/name}","releases_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/releases{/id}","created_at":"2015-10-01T08:06:24Z","updated_at":"2015-10-29T23:58:04Z","pushed_at":"2015-11-26T14:11:25Z","git_url":"git://github.com/jypma/akka-persistence-cassandra-query.git","ssh_url":"git@github.com:jypma/akka-persistence-cassandra-query.git","clone_url":"https://github.com/jypma/akka-persistence-cassandra-query.git","svn_url":"https://github.com/jypma/akka-persistence-cassandra-query","homepage":null,"size":400,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"jypma:master","ref":"master","sha":"fe9250f2db4448cd6d0f6158148367e3b2d8dfe5","user":{"login":"jypma","id":483519,"avatar_url":"https://avatars.githubusercontent.com/u/483519?v=3","gravatar_id":"","url":"https://api.github.com/users/jypma","html_url":"https://github.com/jypma","followers_url":"https://api.github.com/users/jypma/followers","following_url":"https://api.github.com/users/jypma/following{/other_user}","gists_url":"https://api.github.com/users/jypma/gists{/gist_id}","starred_url":"https://api.github.com/users/jypma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jypma/subscriptions","organizations_url":"https://api.github.com/users/jypma/orgs","repos_url":"https://api.github.com/users/jypma/repos","events_url":"https://api.github.com/users/jypma/events{/privacy}","received_events_url":"https://api.github.com/users/jypma/received_events","type":"User","site_admin":false},"repo":{"id":43485121,"name":"akka-persistence-cassandra-query","full_name":"jypma/akka-persistence-cassandra-query","owner":{"login":"jypma","id":483519,"avatar_url":"https://avatars.githubusercontent.com/u/483519?v=3","gravatar_id":"","url":"https://api.github.com/users/jypma","html_url":"https://github.com/jypma","followers_url":"https://api.github.com/users/jypma/followers","following_url":"https://api.github.com/users/jypma/following{/other_user}","gists_url":"https://api.github.com/users/jypma/gists{/gist_id}","starred_url":"https://api.github.com/users/jypma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jypma/subscriptions","organizations_url":"https://api.github.com/users/jypma/orgs","repos_url":"https://api.github.com/users/jypma/repos","events_url":"https://api.github.com/users/jypma/events{/privacy}","received_events_url":"https://api.github.com/users/jypma/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jypma/akka-persistence-cassandra-query","description":"Query plugin implementation for akka-persistence-cassandra","fork":false,"url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query","forks_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/forks","keys_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/teams","hooks_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/hooks","issue_events_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/issues/events{/number}","events_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/events","assignees_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/assignees{/user}","branches_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/branches{/branch}","tags_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/tags","blobs_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/git/refs{/sha}","trees_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/statuses/{sha}","languages_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/languages","stargazers_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/stargazers","contributors_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/contributors","subscribers_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/subscribers","subscription_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/subscription","commits_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/commits{/sha}","git_commits_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/git/commits{/sha}","comments_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/comments{/number}","issue_comment_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/issues/comments{/number}","contents_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/contents/{+path}","compare_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/merges","archive_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/downloads","issues_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/issues{/number}","pulls_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls{/number}","milestones_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/milestones{/number}","notifications_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/labels{/name}","releases_url":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/releases{/id}","created_at":"2015-10-01T08:06:24Z","updated_at":"2015-10-29T23:58:04Z","pushed_at":"2015-11-26T14:11:25Z","git_url":"git://github.com/jypma/akka-persistence-cassandra-query.git","ssh_url":"git@github.com:jypma/akka-persistence-cassandra-query.git","clone_url":"https://github.com/jypma/akka-persistence-cassandra-query.git","svn_url":"https://github.com/jypma/akka-persistence-cassandra-query","homepage":null,"size":400,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls/5"},"html":{"href":"https://github.com/jypma/akka-persistence-cassandra-query/pull/5"},"issue":{"href":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/issues/5"},"comments":{"href":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/jypma/akka-persistence-cassandra-query/statuses/100b52abdef2c26c8f6239adff1fe5473b0aed26"}}}}