{"action":"opened","issue":{"url":"https://api.github.com/repos/louthy/language-ext/issues/55","labels_url":"https://api.github.com/repos/louthy/language-ext/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/louthy/language-ext/issues/55/comments","events_url":"https://api.github.com/repos/louthy/language-ext/issues/55/events","html_url":"https://github.com/louthy/language-ext/issues/55","id":114173228,"number":55,"title":"subscribe<T>, observe<T> don't work for ProcessFlags.ListenRemoteAndLocal and ProcessFlags.PersistState","user":{"login":"mr-kawaii","id":53836,"avatar_url":"https://avatars.githubusercontent.com/u/53836?v=3","gravatar_id":"","url":"https://api.github.com/users/mr-kawaii","html_url":"https://github.com/mr-kawaii","followers_url":"https://api.github.com/users/mr-kawaii/followers","following_url":"https://api.github.com/users/mr-kawaii/following{/other_user}","gists_url":"https://api.github.com/users/mr-kawaii/gists{/gist_id}","starred_url":"https://api.github.com/users/mr-kawaii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mr-kawaii/subscriptions","organizations_url":"https://api.github.com/users/mr-kawaii/orgs","repos_url":"https://api.github.com/users/mr-kawaii/repos","events_url":"https://api.github.com/users/mr-kawaii/events{/privacy}","received_events_url":"https://api.github.com/users/mr-kawaii/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-30T00:17:08Z","updated_at":"2015-10-30T00:17:08Z","closed_at":null,"body":"**Great work!**\r\n\r\nI'm playing around with the **Process + Redis**, I'm on Mac using **Mono**.\r\n\r\nThe **RedisPublishSample** given above by @louthy, the line **\"subscribe<int>(pid, Console.WriteLine)\"** didn't seem to work for me. I did see lots of PUBLISH commands in redid (e.g. *1446114839.593337 [0 127.0.0.1:51072] \"PUBLISH\" \"/redis-test/user/redis-pubsub-random-test-pubsub\" \"1550928543\"*) but absolutely nothing was printed in the terminal. The subscriber part didn't work.\r\n\r\nWhat could be wrong? StackExchange.Redis? I did need to manually recompile StackExchange.Redis under mono, the nugget package didn't work.\r\n\r\nIf I change ProcessFlags.RemotePublish to **ProcessFlags.ListenRemoteAndLocal** then the subscribe part will work. But I presume they are different things / behaviour?\r\n\r\nActually, for **RedisStateSample**, it's the same, however in mac terminal, the number **32** was printed but that was it. So **observeState<int>(pid).Subscribe(Console.WriteLine)** worked once only. Not sure why.\r\n\r\nI will try tomorrow on Windows and see whether the two examples will work as expected.\r\n\r\n**Update**\r\n\r\nI've tested below code in windows and same problem persisted. In console, nothing was printed for RedisPublishSample and RedisStateSample only printed the first number. It was exactly the same as running under mono.\r\n\r\nWould definitely need some suggestions. Thanks.\r\n\r\nI figured I better copy paste my test code here\r\n\r\n```\r\nusing System;\r\nusing LanguageExt;\r\n\r\nnamespace ConsoleApp1\r\n{\r\n    class MainClass\r\n    {\r\n        public static void Main(string[] args)\r\n        {\r\n            RedisCluster.register();\r\n            Cluster.connect(\"redis\", \"redis-test\", \"localhost\", \"0\");\r\n\r\n            PubSubSample();\r\n            StateSample();\r\n\r\n            Console.Read();\r\n        }\r\n\r\n        public static void PubSubSample()\r\n        {\r\n            Func<Random> setup = () => new Random();\r\n            Func<Random, int, Random> inbox = (rnd, value) =>\r\n            {\r\n                Process.publish(value);\r\n                Process.tellSelf(rnd.Next());\r\n                return rnd;\r\n            };\r\n\r\n            var pid = Process.spawn<Random, int>(\r\n                          \"redis-pubsub-random-test\",\r\n                          setup,\r\n                          inbox,\r\n                          ProcessFlags.RemotePublish);//change to ProcessFlags.ListenRemoteAndLocal, then the subscriber part will work, strange?\r\n            \r\n            Process.subscribe<int>(pid, x =>\r\n                {\r\n                    Console.WriteLine(x);\r\n                });\r\n\r\n            //also try using observe without any luck\r\n            Process.observe<int>(pid).Subscribe(x =>\r\n                {\r\n                    Console.WriteLine(x);\r\n                });\r\n\r\n            Process.tell(pid, 0); \r\n        }\r\n\r\n        public static void StateSample()\r\n        {\r\n            Func<int> setup = () => 0;\r\n            Func<int, int, int> inbox = (state, value) =>\r\n            {\r\n                state += value;\r\n                Process.tellSelf(value, TimeSpan.FromSeconds(1));\r\n                return state;\r\n            };\r\n\r\n            var pid = Process.spawn<int, int>(\r\n                          \"redis-state-sample\",\r\n                          setup,\r\n                          inbox,\r\n                          ProcessFlags.PersistState);\r\n            \r\n            Process.observeState<int>(pid).Subscribe(x => {\r\n                Console.WriteLine(x);\r\n            });\r\n\r\n            Process.tell(pid, 1);\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nWould be great if someone can help or shed some light. Thanks.\r\n\r\nThis issue I originally posted in \r\nhttps://github.com/louthy/language-ext/issues/25"}}