Hi,
I have a different perspective on this.

What if we come up with our own session interface that can be used across
> all the transports. For instance, in case of, websockets, I suppose
> following are the APIs we want,
>
> - getID()
> - write() // this should be able to handle text and binary payloads
> - close()
> - isValid()
>
If we look at the JSR-356
<http://www.oracle.com/technetwork/articles/java/jsr356-1937161.html>specification,
there are a lot more APIs we have to introduce in this scenario.
IMHO if we follow our own path we might miss things in the first place and
might have to add new APIs in the future.  Also not Ballerina but MSF4J is
directly using java.websocket.Session API in the implementation. So we'd
better go with the current approach.

I think we can have a init method which returns an Object in the current
implementation. So if someone needs a return object user can cast it and
use.
eg: Object init(CarbonMessage cMsg, Map<String, Object> properties);

WDYT?

Thanks,
Irunika

*Irunika Weeraratne*
*Software Engineer | WSO2, Inc. <http://wso2.com/>*
*Email : irun...@wso2.com <irun...@wso2.com>*
*LinkedIn : https://lk.linkedin.com/in/irunika
<https://lk.linkedin.com/in/irunika>*
*Mobile : +94712403314*
*Lean . Enterprise . Middleware*


On Tue, Jul 4, 2017 at 3:43 PM, Shafreen Anfar <shafr...@wso2.com> wrote:

> Hi All,
>
> What if we come up with our own session interface that can be used across
> all the transports. For instance, in case of, websockets, I suppose
> following are the APIs we want,
>
> - getID()
> - write() // this should be able to handle text and binary payloads
> - close()
> - isValid()
>
> On Thu, Jun 29, 2017 at 4:08 PM, Irunika Weeraratne <irun...@wso2.com>
> wrote:
>
>> Adding Amjadh and Arshardh
>>
>> *Irunika Weeraratne*
>> *Software Engineer | WSO2, Inc. <http://wso2.com/>*
>> *Email : irun...@wso2.com <irun...@wso2.com>*
>> *LinkedIn : https://lk.linkedin.com/in/irunika
>> <https://lk.linkedin.com/in/irunika>*
>> *Mobile : +94712403314 <+94%2071%20240%203314>*
>> *Lean . Enterprise . Middleware*
>>
>>
>> On Thu, Jun 29, 2017 at 4:01 PM, Irunika Weeraratne <irun...@wso2.com>
>> wrote:
>>
>>> Hi,
>>> In the current client connector implementation, there is no way to
>>> initiate a connection. Only send method is available. IMHO it makes
>>> complications for protocols other than HTTP.
>>> eg: JMS subscriber, Initiate WebSocket client, initiate File connector
>>>
>>> IMO it is better to have a init method for client connector and also it
>>> is better to return an object in "send methods" other than a boolean so it
>>> will reduce the complications for other protocol basis work.
>>>
>>> WDYT?
>>>
>>> Thanks,
>>> Irunika
>>>
>>> *Irunika Weeraratne*
>>> *Software Engineer | WSO2, Inc. <http://wso2.com/>*
>>> *Email : irun...@wso2.com <irun...@wso2.com>*
>>> *LinkedIn : https://lk.linkedin.com/in/irunika
>>> <https://lk.linkedin.com/in/irunika>*
>>> *Mobile : +94712403314 <+94%2071%20240%203314>*
>>> *Lean . Enterprise . Middleware*
>>>
>>>
>>
>
>
> --
> Regards,
> *Shafreen*
> Software Engineer
> WSO2 Inc
> Mobile : 077-556-395-1
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to