Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API reference for 0.6.x is missing #24

Open
Flo354 opened this issue Jun 7, 2017 · 5 comments
Open

API reference for 0.6.x is missing #24

Flo354 opened this issue Jun 7, 2017 · 5 comments

Comments

@Flo354
Copy link
Contributor

Flo354 commented Jun 7, 2017

It seems there are breaking changes from 0.5.x to 0.6.x

For instance, there is no method withActor.
@Override public SockJS sockjs() { SockJS.withActor(MySockJSActor::props); }

It would be nice to have a documentation.

Thanks,

@Flo354
Copy link
Contributor Author

Flo354 commented Jun 7, 2017

Okay... As simple as that :

    @Singleton
    public final class AuthorizationSockJSRouter extends SockJSRouter {

        private final ActorSystem system;

        private final Materializer materializer;

        @Inject
        AuthorizationSockJSRouter(ActorSystem system, Materializer materializer) {
            this.system = system;
            this.materializer = materializer;
        }

        @Override
        public SockJS sockjs() {
            return SockJS.Text.accept(request ->
                    ActorFlow.actorRef(MyActor::props, system, materializer));
        }
    }

@fdimuccio
Copy link
Owner

Hi, sorry for the delay.

I removed all API that were deprecated in 0.5. SockJS.withActor was returning
a SockJS implementation based on callback, both have been replaced by an API that expose directly the streaming interface.

I'll update the documentation for the 0.6 release as soon as it will be stable. Do not expect any big change besides those regarding on how to inject the Materializer, DefaultActionBuilder and PlayBodyParsers into the SockJSRouter to integrate better the new Play 2.6 architecture.

@Flo354
Copy link
Contributor Author

Flo354 commented Jun 12, 2017

Thanks for your answer!

Actually, you are using the same way than Play 2.6 : HandlingWebSockets with actors

@fdimuccio
Copy link
Owner

Yes, one goal of this project is to have a set of api that mirror the one provided by Play. In this way it is straightforward to switch from Play WebSocket to play2-sockjs (or viceversa).

@Flo354
Copy link
Contributor Author

Flo354 commented Jun 13, 2017

Thanks.

You can close the issue or let it open until you add the documentation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants