-
Notifications
You must be signed in to change notification settings - Fork 57
Inner Process Clients and Session Meta API. #93
base: master
Are you sure you want to change the base?
Conversation
…+, where ThreadLocalRandom is available, it would use that via introspection.
… code by limiting the scopes for Server and Client initialization code blocks.
…d target/ eclipse directories from version control repo.
… and the ServerTest example is updated to use one of those clients too.
…ications on channels: "wamp.session.on_join" and "wamp.session.on_leave".
Note that the changes I propose, introduce a small risk of breaking current functionality. You can confirm that by studying the code. The new features are "opt in" style. |
…onfiguration options are to follow.
…aller and disclose_publisher are now configurable (enable/disable) via the RouterBuilder. Default is Disabled for security - same as crossbar.io.
Added disclose_caller (supported by jawampa client) and disclose_publisher (for completeness) to the Router. The default behaviour and API is backwards compatible. It is an opt-in feature - same as in crossbar.io implementation. This is the last change I wanted to add. |
Hi Alex,
|
…code to close in-process client which is used by session meta API.
…Matthias247 indirectly suggested.
Hi Matthias, Thank you for your reply.
Apogees for that. You are right about random generator. It is a complete separate piece. Disclose API is separate too. I guess I need to make a separate Github fork for those isolated changes. The session API is based on in-process-client feature, so those are harder to separate. Not sure if Github can help me with it, OR if I need to make a pull request for in-process-client, then wait for it to be merged to your trunk, and only then create another pull request for session API... Anyway, thanks for pointing that out, I will try to do a better job next time.
There few changes seemingly missed being checked in. Apologies, this should be fixed now.
Not sure about it, but I understand that a reflection call could make it feel uncomfortable from the performance perspective. The problem with the original Random class is that it enters a critical section on every call. It is expensive and scales badly with the number of CPU cores.
You talking about generating the compiled class dynamically? Like with cglib? I would say that it is too hard for what we are trying to achieve here.
The problem here is that Android Runtime (ART) is not aligned to Java ME or Java SE standards. So, by lowering runtime compatibility, we are only improving our chance of not using a class which is not implemented on android. For example, Swing classes are not implemented on android entirely, but available in Java since 1.2. As for the source compatibility, sounds like 1.6 is safer choice (see https://developer.android.com/studio/tools/sdk/eclipse-adt.html) But, yes, we need an Android developer to confirm (I am not).
The caller would assume responsibility to close them. In case of meta session API, yes, you are right, I should make sure we close them. ...One sec... FIXED.
I can look into using a thread safe queue, but I am a bit confused as you are talking about a different approach below:
I know what you are saying, I have attempted to do that at first, but then realized that it would require some significant change to the architecture and would more likely introduce some regressions, therefore I changed to the plan "B", the one I have implemented.
Again, quite a significant change. I am concerned that if I would implement a change of this scope you might feel uncomfortable merging it in. If I would start implementing it, I feel that I need to break WampRouter class down to smaller pieces, so it would remain manageable. This might, in turn, break the library API compatibility... The last problem with the above change is that it would be harder for me to justify it in my organization. I have family and kids, and I cannot afford implementing it at my spare time. Those times, when I was doing those type of things, long gone now. ;) So I am doing it at my work time and my company pays for it. Though, thankfully my company kindly agreed to spend some time working on an open source project this time, when we were needed the feature, I would have much harder time trying to convince them that I need to spend much more time to make a more proper implementation. Unfortunately. Would you consider implementing createInProcessClient() for the WampRouter? And also the "helper function on the router that publishes an event to all subscribed clients"? Then I can build all the other changes on top of it. I would not have problems with it. Correct me if I am wrong, but the server seemingly running single threaded. Any plans to make it multithreaded? I might have to look into it too - some time later... Cheers, |
…improve situation related to any threading issues.
…on are now disclosed properly.
…eCaller() or withDisclosePublisher() parameters correctly.
…compartible version by updating its version to the latest.
…at given period and detect broken links.
…G with no data, where it is supposed to PONG the same data as in PING according to 5.5.2 and 5.5.3 of RFC6455.
…lient connection which utilizes Web Socket's PING / PONG mechanism.
…o return the payload of PING.
…t ping if we have not received anything from the other end. Random requests do not guarantee that there will be timely responses. We can only rely on pings for a guaranteed timely responses.
…(4.8). Also testing SVN on HULK.
There are two features in this pull proposal: one feature is an ability to create in process clients, which are connected to the given router:
And the session meta API which publishes to the channel for when a client connects or disconnects. This is an advanced profile feature described here:
Affectively now you can subscribe to "wamp.session.on_leave" channel and get notified when any other clients leaves (disconnects) from the router.
Two channels are supported: "wamp.session.on_join" and "wamp.session.on_leave".
Fell free to criticise any part of the change or whole. I am happy to incorporate any feedback especially quality related.
Cheers,
Alex