[ANN] Radical 0.6

Radical 0.6 was released, including improvments in many fields including
speed and documentation.

It may be downloaded from:
http://idanso.dyndns.org/radical

= Version 0.6

  • Major speed boost.

Key sections of the code were profiled and optimized as much as possible
to reduce the length of the request processing cycle

GServer was dumped in favour of MTServer, it’s way of operation is more
scaleable, keeping a pool of worker threads competing on a
Mutex instead of creating thread for each request.

An additional move was porting Radical::HTTP::Table and
Radical::HTTP::Response to a C extension.

This was combined with a hybrid version of MTServer, part in C and part in
Ruby(the C code used a dirty trick with static variables to avoid using
Mutex).

The result was an additional improvement in speed and scalability. for
details look at docsrc/bookmark.rdoc

  • More documentation

Generated using RDOC

  • Improvements to configuration

Each handler may be assigned a different cache manager

Static content and Dynamic content(scripts) may now sit on different paths

  • Improvements to the DB API

Database pools may be identified not only by pre-configured name but also by
Radical::DB::Database struct

Radical::DB::DBPoll#transaction method provides block-based and less
error-prone approach then get and put

Radical::DB::DBProxy allows accessing the same DBPoll without specifying
it’s name.

  • Modifications to the cache API

The valid? method was dropped, it is now the duty of get do find out if
the request is valid.

get method now must accept a response object as the second parameter

See Radical::Cache::BaseCacheManager

  • Improvements to the template subsystem

Templates may contain methods, these will become part of the object
singleton methods(In other words, each template can define it’s own
interface).

Templates are no longer accepting hashes as a parameter, instead they accept
a list of parameters that are passed to the template init method.

A new syntax has been added - <templateName|methodName> - This
generates a
method whose name is methodName, calling it will add another template,
templateName into this position. The generated method will pass the
parameters to the template.

  • Semi-Functional security manager

The security manager provides an interface for interaction of threads
running at $SAFE=4 to communicate with the rest of the system, including
requesting templates and translations.

Radical::Handlers::SafeRubyScriptHandler already employs this facility, that
in the future will be extended so Radical will be suitable for multi-user
enviroments

  • Minor enhancements and bug fixes
    • MemoryCacheManager added
    • ApacheConnector didn’t pass GET queries - FIXED
    • translation engine caching was broken - FIXED
    • <**>(template inclusion) no longer broken
    • MIME::Types for Ruby was intergrated

Idan Sofer idan@idanso.dyndns.org writes:

[snip Radical News]

Hello.

We plan to use Radical (or at least Ruby) for a project. Looking at
Radical, it doesn’t seems bad at all, but I wonder if there is a way
to make a persistant handler instance.

In fact, we would like to make some things like EJB: a server side
instance of an object, and severals web pages, templates, etc. using
it.

Is it possible with Radical without hacking the radical code?

Regards.

···


Aurelien

Aurélien DEHAY wrote:

Hello.

Hello and thank you for the feedback:)

We plan to use Radical (or at least Ruby) for a project. Looking at
Radical, it doesn’t seems bad at all, but I wonder if there is a way
to make a persistant handler instance.

Please explain what do you mean by “persistent handler instance”?

A handler can be either be a class(in the case a new instance is created
for each incoming request), or be given as an instance of a class(In
this case the same instance is used for all the requests), and it main
duty is to process the HTTP requests, so it’s role is similiar to that
of of a servlet.

So the question arises, how can persistence can be used in this case?

In fact, we would like to make some things like EJB: a server side
instance of an object, and severals web pages, templates, etc. using
it.

That’s an interesting idea…

Idan

Idan Sofer idan@idanso.dyndns.org writes:

Aurélien DEHAY wrote:

Hello.

Hello and thank you for the feedback:)

'Welcome. I think I will have a lot of questions these days :slight_smile:

We plan to use Radical (or at least Ruby) for a project. Looking at
Radical, it doesn’t seems bad at all, but I wonder if there is a way
to make a persistant handler instance.

Please explain what do you mean by “persistent handler instance”?

Excactly what you explain later in fact: a instance of a class.

A handler can be either be a class(in the case a new instance is created
for each incoming request), or be given as an instance of a class(In
this case the same instance is used for all the requests), and it main
duty is to process the HTTP requests, so it’s role is similiar to that
of of a servlet.

Ok. The term “persistant” is not the good one. I mean “persistant
across the lifetime of the server”.

In fact, we want to write a webboard in ruby. So we need to have a
class which manage the messages (with database connection or not), and
some classes to generate the backends (HTML, XML, WML) for the
clients. So, to have a correct management for the messages, I need to
have only one instance of this classe for the site.

I wonder how put this classes in the Radical architecture. The backend
management would be done with handlers, but for the messages
management?

···

So, the question arises, how can persistence can be used in this
case?

In fact, we would like to make some things like EJB: a server side
instance of an object, and severals web pages, templates, etc. using
it.

That’s an interesting idea…

Idan


Aurelien

Idan Sofer idan@idanso.dyndns.org writes:

Aurélien DEHAY wrote:

Hello.

Hello and thank you for the feedback:)

[…]

A handler can be either be a class(in the case a new instance is created
for each incoming request), or be given as an instance of a class(In
this case the same instance is used for all the requests), and it main
duty is to process the HTTP requests, so it’s role is similiar to that
of of a servlet.

I forgot the question: how do I make a handle as a class instance?

[…]

Aurélien DEHAY wrote:

Hello and thank you for the feedback:)

'Welcome. I think I will have a lot of questions these days :slight_smile:

:slight_smile:

A handler can be either be a class(in the case a new instance is created
for each incoming request), or be given as an instance of a class(In
this case the same instance is used for all the requests), and it main
duty is to process the HTTP requests, so it’s role is similiar to that
of of a servlet.

Ok. The term “persistant” is not the good one. I mean “persistant
across the lifetime of the server”.

In fact, we want to write a webboard in ruby. So we need to have a
class which manage the messages (with database connection or not), and
some classes to generate the backends (HTML, XML, WML) for the
clients. So, to have a correct management for the messages, I need to
have only one instance of this classe for the site.

I wonder how put this classes in the Radical architecture. The backend
management would be done with handlers, but for the messages
management?

Well, in this case you might want to code the backend code as a
singleton class, suppose:

require ‘Singleton’
module MBoard
class MBroadManager_
include Singleton
[def bla…]
end
MBoardManager=MBoardManager_.instance
end

That’s perhaps the best way to do things of this kind, and it’s not
specific to Radical(some people suggest writing a singleton as module
but I dislike this approach, it’s a matter of personal perference however).

Then you have the templates(which are kind of pseudo classes, and might
become real classes in the future, inheritence etc), and the handlers or
scripts exeuted by RubyScriptHandler are the “bridge” that connects
everything.

Idan.

Idan Sofer idan@idanso.dyndns.org writes:

Aurélien DEHAY wrote:

[…]

I wonder how put this classes in the Radical architecture. The backend
management would be done with handlers, but for the messages
management?

Well, in this case you might want to code the backend code as a
singleton class, suppose:

require ‘Singleton’
module MBoard
class MBroadManager_
include Singleton
[def bla…]
end
MBoardManager=MBoardManager_.instance
end

Then I can had a such handler in the “handlers” directory, and feed
the config.xml with a extension or a URL for this handler? I must
admit I still have a little problem with singletons classes.

That’s perhaps the best way to do things of this kind, and it’s not
specific to Radical(some people suggest writing a singleton as module
but I dislike this approach, it’s a matter of personal perference however).

Then you have the templates(which are kind of pseudo classes, and might
become real classes in the future, inheritence etc), and the handlers or
scripts exeuted by RubyScriptHandler are the “bridge” that connects
everything.

The main problem I have is the misunderstanding of templates (not with
the how they work, but how the work in Radical).

···

Idan.

Aurélien DEHAY wrote:

require ‘Singleton’
module MBoard
class MBroadManager_
include Singleton
[def bla…]
end
MBoardManager=MBoardManager_.instance
end

Then I can had a such handler in the “handlers” directory, and feed
the config.xml with a extension or a URL for this handler? I must
admit I still have a little problem with singletons classes.

Well, it can generally be everywhere on the $LOAD_PATH, and specified in
config.xml:

<Handler>
  <Require>handlers/myHandler</Require>
  <Selector type="uri">/MB</Selector>
  <Object>DEHAY::Handlers::MBHandler</Object>
</Handler>

The main problem I have is the misunderstanding of templates (not with
the how they work, but how the work in Radical).

Hmm… can you be a bit more specific?

Idan.

Idan Sofer idan@idanso.dyndns.org writes:

[…]

<Handler>
  <Require>handlers/myHandler</Require>
  <Selector type="uri">/MB</Selector>
  <Object>DEHAY::Handlers::MBHandler</Object>
</Handler>

Ok, I think I understand. Well, let’s try that.

The main problem I have is the misunderstanding of templates (not with
the how they work, but how the work in Radical).

Hmm… can you be a bit more specific?

In fact, I presume it’s due to the lack of docs :slight_smile: . Furthermore,
there is no examples in Radical-0.6. Is it possible to take the
examples from Radical-0.5?

···

Idan.

Aurélien DEHAY wrote:

In fact, I presume it’s due to the lack of docs :slight_smile: . Furthermore,
there is no examples in Radical-0.6. Is it possible to take the
examples from Radical-0.5?

Most of the capablities are covered here:

http://idanso.dyndns.org:8081/docs/classes/Radical/Templating.html

You may of course use the examples from Radical 0.5, but they are
primitive and do not exploit the potential added in 0.6.

My original intention was to release 0.6 without examples and later
release the code that currently powers the website, but eventually I
wanted to take it further into a full portal system(named RPortal)

I will now package RPortal at it current state however, if it helps.

Idan.

Idan Sofer idan@idanso.dyndns.org writes:

Aurélien DEHAY wrote:

In fact, I presume it’s due to the lack of docs :slight_smile: . Furthermore,
there is no examples in Radical-0.6. Is it possible to take the
examples from Radical-0.5?

Most of the capablities are covered here:

http://idanso.dyndns.org:8081/docs/classes/Radical/Templating.html

Ok, it seems I’ve missed something in the docs :slight_smile:

You may of course use the examples from Radical 0.5, but they are
primitive and do not exploit the potential added in 0.6.

Ok, I’ll look to all that stuff. I can now begin to code, I will
propably ask some others questions in the next weeks. Thanks for
answering.

My original intention was to release 0.6 without examples and later
release the code that currently powers the website, but eventually I
wanted to take it further into a full portal system(named RPortal)

You want some features request ? :slight_smile:

I will now package RPortal at it current state however, if it helps.

Don’t know if it will help, as you can see, I’ve already some little
difficulties with Radical architecture… But I’ll can do it. I know I
can do it :slight_smile:

···

Idan.


Aurelien