← Back to team overview

syncany-team team mailing list archive

Re: Syncany Watch Operation

 

Hello Vincent,

while implementing GUI / Daemon, I would like to discuss with you the
> opportunity to hook into WatchOperation to get the following information :
> - is it running / stopped / paused ? ==> already ok via AtomicBoolean
> within WatchOperation
> - which files (name / size) are being downloaded / uploaded (UpOperation
> and DownOperation) (not possible at this stage.
>

This is definitely necessary. The Down/UpOperation already return a few
things, among others a "ChangeSet", which is basically lists of added,
changed, and removed files. All we need to do is allow a listener in the
WatchOperation (something like WatchOperation.add/setListener(...), or even
in the constructor). and then react on it after Up/Down is complete and
returned something other than an empty list.

Here are options I have in mind :
> 1/ try to use NotificationListener and adapt it to publish messages
> relating to currently uploaded/downloaded files (filename & size) .
> 2/ implement an eventBus (like Google Guava Event Bus
> https://code.google.com/p/guava-libraries/wiki/EventBusExplained)
>
>
Hm. I don't quite understand the options:

- 1: the NotificationListener's purpose is to notify other clients that
they need to perform a DownOperation -- it uses a small pub/sub server on
notify.syncany.org.
- 2: The Guava EventBus is a good option if the WatchOperation and the GUI
were running in the same JVM; it doesn't work across JVMs though, right?
We'd have to use the WebSocket messages, right? Or am I missing something
here?!


> Is it possible to modify NotificationListener way of working to embedded
> extra information (like a Map<String, Serialisable> of params ?
>
>
Yes, this would be easily possible -- we could send larger messages.
Especially since all clients share a secret key.

Best,
Philipp
<http://pgp.mit.edu>

Follow ups

References