Re: [sprog-users] Re: DBI Gear
Status: Alpha
Brought to you by:
grantm
From: Grant M. <gr...@mc...> - 2005-06-30 10:11:30
|
On Thu, 2005-06-30 at 19:45 +1000, Matthew Keene wrote: > >Obviously Sprog needs the ability to source data from > >a database via DBI. > > I'm trying to write one at the moment. Great! (See I said it was an obvious need). > >The tricky part of writing data source gears is the > >need for non-blocking IO. If someone submits a query that > >takes several minutes to complete, then we obviously want > >the "Stop" button to be functional during that time. > > > Does anyone know if there are any hooks in DBI for > > using it asynchronously? > > I'm not aware of anything built into DBI directly, but > if the application needs to remain responsive while > the query's executing then I would think that threads > would be the best way to go. This is a bit more > elegant than using fork(), Except that no one would describe Perl threads as elegant. The Gtk2 libraries are also reputed to have 'issues' with threads. I haven't tried using them together but I was advised not to by someone who should know :-) > particularly on platforms > where Perl's support for fork is a bit of a kludge I intended to use IPC::Open2/3. Obviously that would use fork on *nix, but on Windows it seems to use the native spawn functions. > One unrelated question: I haven't yet figured out how > you're meant to modify a machine once you've > constructed it (ie add or remove gears). The gears > seem to connect OK when you drag them from the list on > the left, but I haven't yet found a way of > reconnecting gears which become disconnected in the > machine (due to deleting gears), or to connect new > gears in the middle of an existing machine. Is there > something I'm missing ? Yes :-) But you're not the only one. If you want to connect gear B to the output of gear A, then drag B and drop it on A. The secret is that when you drop it, the top left corner of B must be within the outline of A. I plan to redo that area and add support snapping to the closest connector as well as for moving gears with the keyboard. Cheers Grant |