I have a websocket created using the play 2.3 function for the play 2.3 web clip. How can I access an actor created to send messages in another function?
def websocket: WebSocket[JsValue, JsValue] = WebSocket.acceptWithActor[JsValue, JsValue] { req => out => Props(new MyActor(out)) }
Give your actor a link to the manager:
def websocket: WebSocket[JsValue, JsValue] = WebSocket.acceptWithActor[JsValue, JsValue] { req => out => Props(new MyActor(managerRef, out)) }
And make your actor registration manager at preStart.
preStart
Source: https://habr.com/ru/post/1544646/More articles:DownloadManager не сохраняет Загруженные файлы в папке загрузки - androidAdd value to an empty Swift array - arraysjQuery script not working for the first time - jqueryhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1544644/getting-pointers-to-the-real-and-imaginary-parts-of-a-complex-vector-in-c&usg=ALkJrhg50Zb2bX7majnO0mzTzmwwXnQ5-AImplement NSValueTransformer for converted attributes in Swift - swiftHow to effectively scale a video frame using NDK - c ++Какой редактор может выравнивать таблицы в reStructuredText для Sphinx? - editorQuestions / questions from an AngularJS interview - javascriptBase class destructor definition not required? - c ++How can I get the keyboard height of the current input method without showing it? - androidAll Articles