syncany-team team mailing list archive
-
syncany-team team
-
Mailing list archive
-
Message #00619
Re: Syncany GUI
Hi,
Le 10/12/2013 21:21, Philipp Heckel a écrit :
>> Sure, it was a quick test to get update from daemon. Long polling
>> could be achieved through basic java threading. Not as elegant as
>> callback .... but I d'ont see how to do it an other way.
> I'm not sure either. I've asked a couple of people and there does not
> seem to be a good technology for that. Gregor suggest WebSockets which
> allow true two-way communication and I think it's a very elegant
> solution too. The messages could be JSON-based. And it WebSockets are
> supported by many languages already (inkl. pure JavaScript). WebSockets
> Java library with examples: https://github.com/TooTallNate/Java-WebSocket
>
> However, I'm not sure if that does destroy the clear contract of a REST
> based API ...
>
> Any thoughts?
My impression is that REST is by essence disconnected which prevents to
push things from the server to a client. I think that having the gui in
a separate jvm/process/whatever from the daemon is what is really
important in terms of flexibility and cleanliness. So my take would be
not to stick too much to the REST philosophy if it's not convenient.
>> How can that be implemented ? syncany-core could have a EventBus class
>> for handling :
>> - creation of EventBus for the whole application
>> - registering / unregistering of listening classes
>> Then listening classes should just have to have @subscribe method for
>> a dedicated type and register to global eventbus.
> Interesting. I think we should definitely keep that in mind. Right now,
> we have enough things to do :-)
Indeed :-) But we will surely need something in this line of thoughts if
we want to use multiple threads (and that will be a plus in some
situations, think about overlapping multichunks upload with chunking,
for instance).
Cheers,
Fabrice
References