[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Announce: KIO-Sync 0.1.0
From:       Charles Samuels <charles () kde ! org>
Date:       2001-10-27 1:09:04
[Download RAW message or body]


I'm announcing the release of the synchronous KIO Wrapper.

FAQ:

Q. You reimplemented all those protocols?!
A. No, this uses the same kio slaves on your computer already.

Q. Is it threadsafe
A. YES!  (Kinda).  This is different from the normal KIO in that it doesn't 
require an event loop.  Getting data just requires reimplemting virtual 
functions.  This means that you could use KIO in one thread, and UI 
processing in the main thread.  (I could still use slots-n-signals, because 
they don't use the event loop, because I didn't, they're much slower.)

Q. What's all the stuff in the tarball
A. "test" is a program that links to libkiosync and accepts two args.  the 
command, and the URL.  The commands "cat", "ls", and "stat" are supported, 
and do (more or less) what the shell tools do.  Also is libkiosyms, which 
allows LD_PRELOADing!  For example, the following is supported:

LD_PRELOAD=libkiosync.so ls ftp://anonymous:fred%40bob.com:altair.dhs.org/pub/

This uses libkiosync to make the GNU "ls" shell tool able to access KIO.  
(I've had success with ls, stat, and cat only)

Be aware that the libs are in .libs when you try to use this.  You may also 
need LD_LIBRARY_PATH set.  I really wouldn't recommend installing libkiosync.

And expect lots of debug messages.

Q. How complete is the implementation of the KIO protocol?
A. About 30%, I think.  Redirections don't work, but gets, lists and stats 
do.  No put or copy yet.

Q. How complete is this lib in general?
A. It could be better, I have a "Select" class, but I don't use it yet.  
Which means that using one dispatcher for two or more jobs will be slow.  I 
also need to write docs.

Q. How fast is it?
A. In theory, it should be much faster than KIO for stuff like listing a 
directory (which sends lots of signals).  Benchmark it if you will, but as I 
said, multiple jobs per dispatcher isn't a keen idea yet.  I think KIO's 
bottleneck is the Qt signals, which are designed for high level things like 
button presses, not speed critical low level stuff like "A New file 
available, here is the mimetype data."  I have no research to back this up.

Q. Show me an example.
A. No, look in test.cpp:

using namespace KIOS;
using namespace KIOS::Job;

class GetGet : public TransferJob
{
public:
    GetGet(const KURL &url) : TransferJob(url, false)
    { }
 
    void data(const QByteArray &data)
    {
        for (uint i=0; i<data.size(); i++)
            cout << data[i];
    }
};
 
void cat(KURL &src)
{
    Dispatcher d;
 
    GetGet j(src);
    d.add(&j);
 
    d.processAll();
}

Q. License?
A. Pure proprietary.  You may only do this if you write [My name]'s Soul on a 
peice of paper, in your own handwriting, and mail it to me.  Erhm, it's 
actually LGPL, but I havn't said so anywhere (in fact, contradict that by 
saying it's GPL here and there :)

Q. I'm sold, how do I get it?
A. A check or money order to me for $40, I also accept credit cards.  After 
you pay that, you can download it from 
http://www.derkarl.org/kio-sync-0.1.0.tar.bz2 (250kb)


-Charles

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic