[RFC] Using OSYNC_START_TYPE_EXTERNAL

View: New views
2 Messages — Rating Filter:   Alert me  

[RFC] Using OSYNC_START_TYPE_EXTERNAL

by Henrik /KaarPoSoft-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

Re: [RFC] Using OSYNC_START_TYPE_EXTERNAL

by Daniel Gollub-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 25 October 2009 10:59:55 pm Henrik /KaarPoSoft wrote:
> We could add a function called osync_plugin_set_start_external_command
> in opensync_plugin to be called from get_sync_info:

Ok, thats pretty cool! This is defenitly missing in OpenSync.

>
> 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.
Checked your patch (different thread), looks pretty promosing!

Best Regards,
Daniel

--
Daniel Gollub                        Geschaeftsfuehrer: Ralph Dehner
FOSS Developer                       Unternehmenssitz:  Vohburg
B1 Systems GmbH                      Amtsgericht:       Ingolstadt
Mobil: +49-(0)-160 47 73 970         Handelsregister:   HRB 3537
EMail: gollub@...          http://www.b1-systems.de

Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg
http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

signature.asc (204 bytes) Download Attachment