{"action":"created","comment":{"url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/pulls/comments/71409991","id":71409991,"diff_hunk":"@@ -1,82 +1,120 @@\n-﻿using System;\n+﻿//-----------------------------------------------------------------------\n+// <copyright file=\"RedisJournal.cs\" company=\"Akka.NET Project\">\n+//     Copyright (C) 2009-2016 Lightbend Inc. <http://www.lightbend.com>\n+//     Copyright (C) 2013-2016 Akka.NET project <https://github.com/akkadotnet/akka.net>\n+// </copyright>\n+//-----------------------------------------------------------------------\n+\n+using System;\n using System.Collections.Generic;\n using System.Collections.Immutable;\n using System.Linq;\n using System.Threading.Tasks;\n using Akka.Actor;\n using Akka.Persistence.Journal;\n-using RedisBoost;\n-using RedisBoost.Core.Serialization;\n+using Akka.Serialization;\n+using Akka.Util.Internal;\n+using StackExchange.Redis;\n \n namespace Akka.Persistence.Redis.Journal\n {\n     public class RedisJournal : AsyncWriteJournal\n     {\n         private readonly RedisSettings _settings = RedisPersistence.Get(Context.System).JournalSettings;\n-        private readonly IRedisClientsPool _pool;\n-        private readonly BasicRedisSerializer _serializer;\n-\n-        public RedisJournal()\n-        {\n-            _serializer = new RedisPersistenceSerializer(Context.System);\n-            _pool = RedisClient.CreateClientsPool();\n-        }\n+        private Lazy<Serializer> _serializer;\n+        private Lazy<IDatabase> _database;\n+        private ActorSystem _system;\n \n-        protected override void PostStop()\n+        protected override void PreStart()\n         {\n-            base.PostStop();\n-\n-            _pool.Dispose();\n+            base.PreStart();\n+            _system = Context.System;\n+            _database = new Lazy<IDatabase>(() =>","path":"src/Akka.Persistence.Redis/Journal/RedisJournal.cs","position":47,"original_position":47,"commit_id":"9ede131d47a5653777c84a36b053e760e53fc9ae","original_commit_id":"9ede131d47a5653777c84a36b053e760e53fc9ae","user":{"login":"Horusiath","id":679705,"avatar_url":"https://avatars.githubusercontent.com/u/679705?v=3","gravatar_id":"","url":"https://api.github.com/users/Horusiath","html_url":"https://github.com/Horusiath","followers_url":"https://api.github.com/users/Horusiath/followers","following_url":"https://api.github.com/users/Horusiath/following{/other_user}","gists_url":"https://api.github.com/users/Horusiath/gists{/gist_id}","starred_url":"https://api.github.com/users/Horusiath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Horusiath/subscriptions","organizations_url":"https://api.github.com/users/Horusiath/orgs","repos_url":"https://api.github.com/users/Horusiath/repos","events_url":"https://api.github.com/users/Horusiath/events{/privacy}","received_events_url":"https://api.github.com/users/Horusiath/received_events","type":"User","site_admin":false},"body":"Doesn't database need to be disposed at some point?","created_at":"2016-07-19T19:47:52Z","updated_at":"2016-07-19T19:47:52Z","html_url":"https://github.com/akkadotnet/Akka.Persistence.Redis/pull/4#discussion_r71409991","pull_request_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/pulls/comments/71409991"},"html":{"href":"https://github.com/akkadotnet/Akka.Persistence.Redis/pull/4#discussion_r71409991"},"pull_request":{"href":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/pulls/4","id":78033353,"html_url":"https://github.com/akkadotnet/Akka.Persistence.Redis/pull/4","diff_url":"https://github.com/akkadotnet/Akka.Persistence.Redis/pull/4.diff","patch_url":"https://github.com/akkadotnet/Akka.Persistence.Redis/pull/4.patch","issue_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/issues/4","number":4,"state":"open","locked":false,"title":"Initial commit with StackExchange.Redis","user":{"login":"alexvaluyskiy","id":4232072,"avatar_url":"https://avatars.githubusercontent.com/u/4232072?v=3","gravatar_id":"","url":"https://api.github.com/users/alexvaluyskiy","html_url":"https://github.com/alexvaluyskiy","followers_url":"https://api.github.com/users/alexvaluyskiy/followers","following_url":"https://api.github.com/users/alexvaluyskiy/following{/other_user}","gists_url":"https://api.github.com/users/alexvaluyskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/alexvaluyskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexvaluyskiy/subscriptions","organizations_url":"https://api.github.com/users/alexvaluyskiy/orgs","repos_url":"https://api.github.com/users/alexvaluyskiy/repos","events_url":"https://api.github.com/users/alexvaluyskiy/events{/privacy}","received_events_url":"https://api.github.com/users/alexvaluyskiy/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-19T19:19:42Z","updated_at":"2016-07-19T19:47:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fe3240675dc8c1623c7e4db162644bb40b11039","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/pulls/4/commits","review_comments_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/pulls/4/comments","review_comment_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/issues/4/comments","statuses_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/statuses/9ede131d47a5653777c84a36b053e760e53fc9ae","head":{"label":"alexvaluyskiy:stackexchange","ref":"stackexchange","sha":"9ede131d47a5653777c84a36b053e760e53fc9ae","user":{"login":"alexvaluyskiy","id":4232072,"avatar_url":"https://avatars.githubusercontent.com/u/4232072?v=3","gravatar_id":"","url":"https://api.github.com/users/alexvaluyskiy","html_url":"https://github.com/alexvaluyskiy","followers_url":"https://api.github.com/users/alexvaluyskiy/followers","following_url":"https://api.github.com/users/alexvaluyskiy/following{/other_user}","gists_url":"https://api.github.com/users/alexvaluyskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/alexvaluyskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexvaluyskiy/subscriptions","organizations_url":"https://api.github.com/users/alexvaluyskiy/orgs","repos_url":"https://api.github.com/users/alexvaluyskiy/repos","events_url":"https://api.github.com/users/alexvaluyskiy/events{/privacy}","received_events_url":"https://api.github.com/users/alexvaluyskiy/received_events","type":"User","site_admin":false},"repo":{"id":63721345,"name":"Akka.Persistence.Redis","full_name":"alexvaluyskiy/Akka.Persistence.Redis","owner":{"login":"alexvaluyskiy","id":4232072,"avatar_url":"https://avatars.githubusercontent.com/u/4232072?v=3","gravatar_id":"","url":"https://api.github.com/users/alexvaluyskiy","html_url":"https://github.com/alexvaluyskiy","followers_url":"https://api.github.com/users/alexvaluyskiy/followers","following_url":"https://api.github.com/users/alexvaluyskiy/following{/other_user}","gists_url":"https://api.github.com/users/alexvaluyskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/alexvaluyskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexvaluyskiy/subscriptions","organizations_url":"https://api.github.com/users/alexvaluyskiy/orgs","repos_url":"https://api.github.com/users/alexvaluyskiy/repos","events_url":"https://api.github.com/users/alexvaluyskiy/events{/privacy}","received_events_url":"https://api.github.com/users/alexvaluyskiy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexvaluyskiy/Akka.Persistence.Redis","description":"Akka.Persistence plugin for Redis backend.","fork":true,"url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis","forks_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/forks","keys_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/teams","hooks_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/hooks","issue_events_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/issues/events{/number}","events_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/events","assignees_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/assignees{/user}","branches_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/branches{/branch}","tags_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/tags","blobs_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/statuses/{sha}","languages_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/languages","stargazers_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/stargazers","contributors_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/contributors","subscribers_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/subscribers","subscription_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/subscription","commits_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/contents/{+path}","compare_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/merges","archive_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/downloads","issues_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/issues{/number}","pulls_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/pulls{/number}","milestones_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/milestones{/number}","notifications_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/labels{/name}","releases_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/releases{/id}","deployments_url":"https://api.github.com/repos/alexvaluyskiy/Akka.Persistence.Redis/deployments","created_at":"2016-07-19T19:16:13Z","updated_at":"2016-07-19T19:16:14Z","pushed_at":"2016-07-19T19:19:19Z","git_url":"git://github.com/alexvaluyskiy/Akka.Persistence.Redis.git","ssh_url":"git@github.com:alexvaluyskiy/Akka.Persistence.Redis.git","clone_url":"https://github.com/alexvaluyskiy/Akka.Persistence.Redis.git","svn_url":"https://github.com/alexvaluyskiy/Akka.Persistence.Redis","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"dev"}},"base":{"label":"akkadotnet:dev","ref":"dev","sha":"a3244f8396e3e2507980c7c7cc0f28c45ddf288e","user":{"login":"akkadotnet","id":7003835,"avatar_url":"https://avatars.githubusercontent.com/u/7003835?v=3","gravatar_id":"","url":"https://api.github.com/users/akkadotnet","html_url":"https://github.com/akkadotnet","followers_url":"https://api.github.com/users/akkadotnet/followers","following_url":"https://api.github.com/users/akkadotnet/following{/other_user}","gists_url":"https://api.github.com/users/akkadotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/akkadotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akkadotnet/subscriptions","organizations_url":"https://api.github.com/users/akkadotnet/orgs","repos_url":"https://api.github.com/users/akkadotnet/repos","events_url":"https://api.github.com/users/akkadotnet/events{/privacy}","received_events_url":"https://api.github.com/users/akkadotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":53739424,"name":"Akka.Persistence.Redis","full_name":"akkadotnet/Akka.Persistence.Redis","owner":{"login":"akkadotnet","id":7003835,"avatar_url":"https://avatars.githubusercontent.com/u/7003835?v=3","gravatar_id":"","url":"https://api.github.com/users/akkadotnet","html_url":"https://github.com/akkadotnet","followers_url":"https://api.github.com/users/akkadotnet/followers","following_url":"https://api.github.com/users/akkadotnet/following{/other_user}","gists_url":"https://api.github.com/users/akkadotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/akkadotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akkadotnet/subscriptions","organizations_url":"https://api.github.com/users/akkadotnet/orgs","repos_url":"https://api.github.com/users/akkadotnet/repos","events_url":"https://api.github.com/users/akkadotnet/events{/privacy}","received_events_url":"https://api.github.com/users/akkadotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akkadotnet/Akka.Persistence.Redis","description":"Akka.Persistence plugin for Redis backend.","fork":false,"url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis","forks_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/forks","keys_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/teams","hooks_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/hooks","issue_events_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/issues/events{/number}","events_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/events","assignees_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/assignees{/user}","branches_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/branches{/branch}","tags_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/tags","blobs_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/git/refs{/sha}","trees_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/statuses/{sha}","languages_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/languages","stargazers_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/stargazers","contributors_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/contributors","subscribers_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/subscribers","subscription_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/subscription","commits_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/commits{/sha}","git_commits_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/git/commits{/sha}","comments_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/comments{/number}","issue_comment_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/issues/comments{/number}","contents_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/contents/{+path}","compare_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/merges","archive_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/downloads","issues_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/issues{/number}","pulls_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/pulls{/number}","milestones_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/milestones{/number}","notifications_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/labels{/name}","releases_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/releases{/id}","deployments_url":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/deployments","created_at":"2016-03-12T15:46:19Z","updated_at":"2016-03-17T21:27:54Z","pushed_at":"2016-07-19T19:19:42Z","git_url":"git://github.com/akkadotnet/Akka.Persistence.Redis.git","ssh_url":"git@github.com:akkadotnet/Akka.Persistence.Redis.git","clone_url":"https://github.com/akkadotnet/Akka.Persistence.Redis.git","svn_url":"https://github.com/akkadotnet/Akka.Persistence.Redis","homepage":null,"size":14,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":1,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/pulls/4"},"html":{"href":"https://github.com/akkadotnet/Akka.Persistence.Redis/pull/4"},"issue":{"href":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/issues/4"},"comments":{"href":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/akkadotnet/Akka.Persistence.Redis/statuses/9ede131d47a5653777c84a36b053e760e53fc9ae"}}}}
{"actor":{"display_login":"Horusiath"}}