{"action":"closed","issue":{"url":"https://api.github.com/repos/dhlab-basel/Knora/issues/55","repository_url":"https://api.github.com/repos/dhlab-basel/Knora","labels_url":"https://api.github.com/repos/dhlab-basel/Knora/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/dhlab-basel/Knora/issues/55/comments","events_url":"https://api.github.com/repos/dhlab-basel/Knora/issues/55/events","html_url":"https://github.com/dhlab-basel/Knora/issues/55","id":136761052,"number":55,"title":"How to create an ActorRef outside an actor?","user":{"login":"tobiasschweizer","id":6000023,"avatar_url":"https://avatars.githubusercontent.com/u/6000023?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiasschweizer","html_url":"https://github.com/tobiasschweizer","followers_url":"https://api.github.com/users/tobiasschweizer/followers","following_url":"https://api.github.com/users/tobiasschweizer/following{/other_user}","gists_url":"https://api.github.com/users/tobiasschweizer/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiasschweizer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiasschweizer/subscriptions","organizations_url":"https://api.github.com/users/tobiasschweizer/orgs","repos_url":"https://api.github.com/users/tobiasschweizer/repos","events_url":"https://api.github.com/users/tobiasschweizer/events{/privacy}","received_events_url":"https://api.github.com/users/tobiasschweizer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-02-26T17:32:38Z","updated_at":"2016-03-01T08:31:26Z","closed_at":"2016-03-01T08:31:26Z","body":"Hi\r\n\r\nWhat would be the best way to create an `ActorRef`outside an Actor (outside a class that extends `Actor`)?\r\n\r\nOn my branch `wip/setup_fake_responders`, I created a `TestResponderManagerV1` that extends `ResponderManager` and has access to all its definitions of the live routes.\r\n\r\nHowever, each of these routes can be overridden in case someone passes a mock or fake responder:\r\n\r\n```scala\r\noverride val sipiRouter = actor(\"mocksipi\")(new Act {\r\n        become {\r\n            case sipiResponderConversionFileRequest: SipiResponderConversionFileRequestV1 => future2Message(sender(), imageConversionResponse(sipiResponderConversionFileRequest), log)\r\n            case sipiResponderConversionPathRequest: SipiResponderConversionPathRequestV1 => future2Message(sender(), imageConversionResponse(sipiResponderConversionPathRequest), log)\r\n        }\r\n    })\r\n``` \r\n\r\nWhat would be the best way to create an actor in a test like `SipiV1E2ESpec` to pass it to `TestResponderManagerV1` then?\r\n\r\nThe problem is that extending `Actor` and `ActorLogging` provides a lot of stuff that you have to explicitly deal with outside this context, like the logger or the `ActorContext` (` implicit ActorRefFactory required: if outside of an Actor you need an implicit ActorSystem, inside of an actor this should be the implicit ActorContext`).\r\n\r\nSo somehow I am breaking the design by creating those actors outside of an Actor.\r\n\r\nCC: @subotic @benjamingeer  \r\n\r\n  "}}