{"action":"created","issue":{"url":"https://api.github.com/repos/badoo/MVICore/issues/68","repository_url":"https://api.github.com/repos/badoo/MVICore","labels_url":"https://api.github.com/repos/badoo/MVICore/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/badoo/MVICore/issues/68/comments","events_url":"https://api.github.com/repos/badoo/MVICore/issues/68/events","html_url":"https://github.com/badoo/MVICore/issues/68","id":420118806,"node_id":"MDU6SXNzdWU0MjAxMTg4MDY=","number":68,"title":"What is the best way to interrupt async operation?","user":{"login":"NobodyLikesZergs","id":12110564,"node_id":"MDQ6VXNlcjEyMTEwNTY0","avatar_url":"https://avatars1.githubusercontent.com/u/12110564?v=4","gravatar_id":"","url":"https://api.github.com/users/NobodyLikesZergs","html_url":"https://github.com/NobodyLikesZergs","followers_url":"https://api.github.com/users/NobodyLikesZergs/followers","following_url":"https://api.github.com/users/NobodyLikesZergs/following{/other_user}","gists_url":"https://api.github.com/users/NobodyLikesZergs/gists{/gist_id}","starred_url":"https://api.github.com/users/NobodyLikesZergs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NobodyLikesZergs/subscriptions","organizations_url":"https://api.github.com/users/NobodyLikesZergs/orgs","repos_url":"https://api.github.com/users/NobodyLikesZergs/repos","events_url":"https://api.github.com/users/NobodyLikesZergs/events{/privacy}","received_events_url":"https://api.github.com/users/NobodyLikesZergs/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2019-03-12T17:37:42Z","updated_at":"2019-03-27T02:24:49Z","closed_at":"2019-03-12T17:55:31Z","author_association":"NONE","body":"Is it possible to interrupt operations started by Actor? In my case single Wish generate a chain of requests. How can i prevent execution of remaining requests when new Wish arrives?"},"comment":{"url":"https://api.github.com/repos/badoo/MVICore/issues/comments/476939449","html_url":"https://github.com/badoo/MVICore/issues/68#issuecomment-476939449","issue_url":"https://api.github.com/repos/badoo/MVICore/issues/68","id":476939449,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3NjkzOTQ0OQ==","user":{"login":"qwert2603","id":10666225,"node_id":"MDQ6VXNlcjEwNjY2MjI1","avatar_url":"https://avatars3.githubusercontent.com/u/10666225?v=4","gravatar_id":"","url":"https://api.github.com/users/qwert2603","html_url":"https://github.com/qwert2603","followers_url":"https://api.github.com/users/qwert2603/followers","following_url":"https://api.github.com/users/qwert2603/following{/other_user}","gists_url":"https://api.github.com/users/qwert2603/gists{/gist_id}","starred_url":"https://api.github.com/users/qwert2603/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qwert2603/subscriptions","organizations_url":"https://api.github.com/users/qwert2603/orgs","repos_url":"https://api.github.com/users/qwert2603/repos","events_url":"https://api.github.com/users/qwert2603/events{/privacy}","received_events_url":"https://api.github.com/users/qwert2603/received_events","type":"User","site_admin":false},"created_at":"2019-03-27T02:24:49Z","updated_at":"2019-03-27T02:24:49Z","author_association":"NONE","body":"@ShikaSD @zsoltk \r\nCould it be cleaner to create extra `Actor` class with signature `(Observable<Pair<State, Action>>) -> Observable<Effect>` ?\r\n\r\nThat will allow to cancel async operations like:\r\n\r\n```\r\ninterface ActorObservable<State, Action, Effect> {\r\n    fun invoke(input: Observable<Pair<State, Action>>): Observable<Effect>\r\n}\r\n\r\nsealed class Action {\r\n    object Action1 : Action()\r\n    object Action2 : Action()\r\n}\r\n\r\ndata class Effect(val i: Int)\r\n\r\nclass ActorImpl<State> : ActorObservable<State, Action, Effect> {\r\n    override fun invoke(input: Observable<Pair<State, Action>>): Observable<Effect> {\r\n        return input\r\n                .switchMap { (state, action) ->\r\n                    when (action) {\r\n                        Action.Action1 -> Observable\r\n                                .interval(1, TimeUnit.SECONDS)\r\n                                .map { Effect(1) }\r\n                        Action.Action2 -> Observable\r\n                                .interval(2, TimeUnit.SECONDS)\r\n                                .map { Effect(2) }\r\n                    }\r\n                }\r\n    }\r\n}\r\n```"}}
{"actor":{"display_login":"qwert2603"}}