|
|
|
|||||
|
Ice/Ruby/Qt example
Cool! What a nice surprise at the end of the holidays.
![]() After looking at the demos shipped with IceRuby, I decided to push it somewhat further and came up with version 0.1 of QtClient.rb for the "hello" server. Please refer to the attached file for the code; details follow here. My configuration is OpenSUSE 10.0 with KDE 3.5.5 (kdebase3-3.5.5-17.1, qt3-3.3.6-185.1) and Ruby 1.8.2 (ruby-1.8.2-11.6). First I tried to upgrade to Ruby 1.8.5 as requested by IceRuby, but after I got hung up by kdebindings3-3.5.5-32.1, I decided to relax the requirements by patching config/Make.rules instead. ![]() When IceRuby compiled with Ruby 1.8.2, I modified the local environment appropriately by sourcing the shell file setupIceRuby. Then I merged code and ideas from the Qt/C++ "hello" client and the IceRuby console example, and came up with an initial version of QtClient.rb; this does not (yet) make use of a CallQueue as its C++ twin, but it seems to work just fine. Of course, comments are very much appreciated. Finally I changed the example config.client for the "linux" local host. Cheers Last edited by Andreas Scherer : 11-06-2006 at 04:13 PM. |
|
|||||
|
Can someone confirm that the CallQueue mechanism is currently not supportable in IceRubyQt? According to Richard Dale (http://lists.kde.org/?l=kde-bindings&m=112973788316454), Ruby threads can not be used in a QtRuby application (and IceUtil::Thread/Mutex are not available).
Today I tried without success to make QtClient.rb responsive in case of long-running server events. However, as long as I do not join my callThread (aka playerThread or consumerThread) prior to qtapp.exec, the "Hello" button works synchronously. If I invoke callThread.join before qtapp.exec, the program aborts with a deadlock exception (presumably because the Queue runs empty?). Help and comments are welcome! |
|
|||||
|
Thanks, Mark.
It's not a pressing issue for me right now, so my initial QtClient.rb will have to stand as a nice proof-of-concept. Note that the updated attachment to my first submission now destroys the communicator; this part got thrown out with the surrounding CallQueue stuff. Greetings |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ruby client and VC 2005EE client | PeteH | Help Center | 1 | 02-26-2007 04:17 AM |
| Ice for Ruby Preview Release now available | mes | Announcements | 0 | 10-27-2006 01:55 PM |
| Program implementation / File Transfer Questions (yes, i have read the faq :) )/ Ruby | EmmanuelOga | Help Center | 2 | 08-01-2006 06:58 PM |
| Ruby ICE binding | jrimmer | Comments | 3 | 04-08-2005 09:32 PM |