|
From: Henrik /K. <he...@ka...> - 2009-10-25 22:00:15
|
Dear all, I am working on porting mozilla-sync to use OSYNC_START_TYPE_EXTERNAL. I have a "proof-of-concept" which works "by hand" in a debugging environment. I will provide details later on this list for those who might me interested. However, there are two conceptual issues, that I would like to discuss with the community: (1) How to start the external process (2) How to tell the external process which pipe to use Currently, in my mozilla-sync "proof-of-concept" I do this: a) use osynctool to create group and members b) launch osynctool --discover or --sync c) manually start the external process and pass it the pipe name on the command line (using a pipe name I worked out "manually" using knowledge on how OpenSync works, and the groups I created) In principle, this could also be used in a production environment. However, this means that it will be the resposability of the caller to create the external process, and pass the name of the pipe to it. This can be a bit tricky, especially if the caller did not create the group/members in the first place. I.e. before launching osynctool (or, in a production environment: before starting your own sync in your own GUI), you would need to work out which external processes to start, and which pipenames to pass to it, and how. It would be difficult for a generic GUI to know how to do this. Even in the case-in-point (mozilla-sync) it is difficult. Yes the GUI plugin could osync_member_get_configdir and append /pluginpipe, but this really makes a lot of assumptions on closed OpenSync functionality. And if we do a mozilla-sync to mozilla-sync sync, it gets even more long-haired. So, how do we solve the two issues: (1) How to start the external process (2) How to tell the external process which pipe to use I think that the information on those issues needs to be carried in the plugin configurations. If this could be made to work, "any" generic GUI could just start the sync, and the plugin/OpenSync would take care of the rest. Proposal: We could add a function called osync_plugin_set_start_external_command in opensync_plugin to be called from get_sync_info: This function could be passed a string in printf format (e.g. "start-external-process %s"), and osync_client_proxy_spawn could call g_strdup_printf with the pipe name as an argument, and execute the resulting command with g_spawn_command_line_async. I do not know about other external processes, but with blueZync plugin installed, if you launch "thunderbird --mozilla-sync=/path/to/pipe" it will create a new thunderbird instance if one is not already running, otherwise it will connect to the running thunderbird, which is exactly what we need. Comments on this would be most appreciated. /Henrik |