← Back to team overview

syncany-team team mailing list archive

Re: Syncany Daemon / Gui


Hi Christof,

For example for sharing data via torrent a seeding-process is needed
> that runs the torrent library. It would be great if plugins could hook
> into that daemon and have a custom method run in their own thread inside
> that daemon.
> How do you feel about plugins being able to register tasks at the daemon
> process which will run them?

Yes, I think that's a good idea. However, that goes beyond what we have
today. What this means is that some of the code would actually live outside
the WatchOperation -- which means that the particular plugin will only work
if it is used with the daemon, and not in regular CLI mode.

>From the top of my head, how about something like this:

In the daemon:
   for each plugin in used by the daemon:
     if (plugin.daemonRequired()) {
        plugin.startBackgroundThread(this); // this = listener

It is not clear to me how signalling could be achieved in that situation
> or even how Exceptions should be handled. Should the daemon handle them?

Communication should be done with regular listeners between the
WatchOperation code and the background thread. Exceptions can be wrapped in
messages and passed along. Not very elegant, but hey ...

Happy to provide feedback and keep on brainstorming with you; but I can't
spend time on coding this :-D -- as you probably know, I have to focus on
the core code.


Follow ups