Re: YAM (Yet Another Module) - an IPC shared cache thing - anyone interested ?

2000-07-23 Thread Greg Cope

Joshua Chamas wrote:
> 

> I would recommend using Apache::ASP as it does everything you need.
> First it allows for creation of your dynamic tags:
> 
>   http://www.nodeworks.com/xml.html
> 
> It will reload all of your templates dynamically at runtime, for
> ease of development but also has advanced server startup parent
> httpd compilation abilities for greatest scalability, where templates
> are shared across child forks:
> 
>   http://www.nodeworks.com/asp/tuning.html#Precompile%20Scripts
> 
> Finally, it will give your designers a comfortable ASP scripting
> environment, while giving you the developer powerful APIs like
> the Script_OnStart event which you can use to customize the
> global environment available to each script:
> 
>   http://www.nodeworks.com/asp/events.html#Script_OnStart%20%26%20Script_OnEnd
> 
> If you think its scarey that designers might be able to execute
> arbitrary perl code in <% %> blocks, I have thought about allowing
> a config option to turn these blocks off, so the compiler will
> just strip them or render the raw code by default.  Might be like
> 
>   PerlSetVar CodeBlocks 0
> 
> This way, your designers would only be able to use the custom tags
> that you provide for them.


Thanks Joshua

I was aware that Apache::ASP did all the some of these things but not
all of this - and I see you will be including some XML support  I am
truely impressed (the caching bit, and the script environment changes).

My aims have thus far been to write my own modules that just do what I
need and no more, so that Firstly its efficient (no excess code, not to
say Apache::ASP has any of that ;-), and Secoundly to learn some more.

This does mean I reinvent the wheel code wise, compared to projects like
yours, HTML::Embperl, HTML::Template - but I'll learning in the mean
time.  I am not expecting to release anything on CPAN or for the code to
be used by anyone else.

If anything I've been introduced to HML::Template - which is just the
lightwieght templating module that would help with my present (work)
project (I'd use my own  module, but using a maintained CPAN module
would be better for my clients in the long term (i.e after I've left)).

Thanks again for the pointer.

Greg Cope

> 
> -- Joshua
> _
> Joshua Chamas   Chamas Enterprises Inc.
> NodeWorks >> free web link monitoring   Huntington Beach, CA  USA
> http://www.nodeworks.com1-714-625-4051




Re: YAM (Yet Another Module) - an IPC shared cache thing - anyone interested ?

2000-07-22 Thread Joshua Chamas

Greg Cope wrote:
> 
> Dear All
> 
> I've writen a small IPC sysV based shared cache thingy ... (useing
> IPC::ShareLite), and I'd like some comments oin the design if anywants
> to crtique...
> 
> Why / the problem:
> 
> I work in a dept where the coderes (Me !) code, and the HTML design
> people do HTML.  The only commonality we share is that we agree on a tag
> name (place holder ... where they want my dynamic content to go) and the
> size of the content to be placed.  They then create the HTML (templates)
> with tags, and I code perl that looks for these tags in the templates.
> 

I would recommend using Apache::ASP as it does everything you need.
First it allows for creation of your dynamic tags:

  http://www.nodeworks.com/xml.html

It will reload all of your templates dynamically at runtime, for
ease of development but also has advanced server startup parent 
httpd compilation abilities for greatest scalability, where templates 
are shared across child forks:

  http://www.nodeworks.com/asp/tuning.html#Precompile%20Scripts
  
Finally, it will give your designers a comfortable ASP scripting
environment, while giving you the developer powerful APIs like
the Script_OnStart event which you can use to customize the
global environment available to each script:

  http://www.nodeworks.com/asp/events.html#Script_OnStart%20%26%20Script_OnEnd

If you think its scarey that designers might be able to execute
arbitrary perl code in <% %> blocks, I have thought about allowing
a config option to turn these blocks off, so the compiler will
just strip them or render the raw code by default.  Might be like 

  PerlSetVar CodeBlocks 0

This way, your designers would only be able to use the custom tags
that you provide for them.

-- Joshua
_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks >> free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



Re: YAM (Yet Another Module) - an IPC shared cache thing - anyone interested ?

2000-07-22 Thread Greg Cope

Francesco Pasqualini wrote:
> 
> is it possible to use IPC sysV  to share DBI connection between apache
> childs ?

IIRC this is not possible as DBI connections are special magic things -
this was discussed on the list a few months back - but I cannot remember
the name of the thread.


Greg Cope
 
> What I'm looking for is the possibility to store a DBI connections in the
> $Session
> object (Apache::ASP or Apache::Session).
> In this way we can start a DB connection for each user session and we can
> have different application using differnet DB.
> 
> The connection is started when the user session start, is maintened in
> memory, it is visible to all the apache childs and will be closed at session
> end.
> 
> thanks
>



Re: YAM (Yet Another Module) - an IPC shared cache thing - anyone interested ?

2000-07-22 Thread Francesco Pasqualini

is it possible to use IPC sysV  to share DBI connection between apache
childs ?

What I'm looking for is the possibility to store a DBI connections in the
$Session
object (Apache::ASP or Apache::Session).
In this way we can start a DB connection for each user session and we can
have different application using differnet DB.

The connection is started when the user session start, is maintened in
memory, it is visible to all the apache childs and will be closed at session
end.


thanks

- Original Message -
From: "Greg Cope" <[EMAIL PROTECTED]>
To: "Modperl list" <[EMAIL PROTECTED]>
Sent: Friday, July 21, 2000 8:58 PM
Subject: YAM (Yet Another Module) - an IPC shared cache thing - anyone
interested ?


> Dear All
>
> I've writen a small IPC sysV based shared cache thingy ... (useing
> IPC::ShareLite), and I'd like some comments oin the design if anywants
> to crtique...
>





Re: YAM (Yet Another Module) - an IPC shared cache thing - anyone interested...

2000-07-22 Thread JoshNarins

[EMAIL PROTECTED] writes:

[No StatINC because...]
> I do not use it to store perl modules, only to store all my html templates.
>
> Does that make sense ?

Well, it isn't scalable past one machine, you know. As long as you are willing
to live with that, fine.

If that is a problem, I'm not sure if StatINC would even need any rework if 
you
are willing to "require" the Templates.

Best of luck,
-JoshNarins

--
-
 I never knew the point of Linux. I was a UNIX sys admin. I mean, why UNIX if 
you  
 aren't on a sparc or alpha processor? Then I actually used Windows.



Re: YAM (Yet Another Module) - an IPC shared cache thing - anyone interested ?

2000-07-22 Thread Greg Cope

[EMAIL PROTECTED] wrote:
> 
> Sorry, sounds like you could have just used Apache::StatINC, no?

Apache::StatINC only reloads your perl modules if they change.

My module loads (HTML) templates into a shared IPC memory segment - or
rather anything that can be stored as a scalar (limits of IPC::ShareLite
- if you need to store other things you would need to use Storable, or
Data::Dumper).

I do not use it to store perl modules, only to store all my html
templates.

Does that make sense ?

Greg Cope




YAM (Yet Another Module) - an IPC shared cache thing - anyone interested ?

2000-07-22 Thread Greg Cope

Dear All

I've writen a small IPC sysV based shared cache thingy ... (useing
IPC::ShareLite), and I'd like some comments oin the design if anywants
to crtique...

Why / the problem:

I work in a dept where the coderes (Me !) code, and the HTML design
people do HTML.  The only commonality we share is that we agree on a tag
name (place holder ... where they want my dynamic content to go) and the
size of the content to be placed.  They then create the HTML (templates)
with tags, and I code perl that looks for these tags in the templates.

Nothing special so far. (The templating module is very, very simple and
only deals with new tags and
templates).

When mod_perling I used to load all the templates into an object that
had one class attribute - a hash of these templates.  The apache
children can create a new object(s) that will have the templates in the
class attribute 'cache'.  This is fine until you want to change anything
- you need an apache restart.  This was not really an issue, until we
had a new design which had often changing nav bars because new sections
are added / removed (often being daily sometimes hourly at times).

A Solution

Not whishing to use mod_perl to create any semi dynamic data (changes
daily /
hourly) etc. I thought about Sysv shared memory and
IPC::ShareLite.  Having had a "classical" Database training, I normalise
everything into modules quite aggressively (or at least try to think I
do).

Hence I want these templates in memory, and shared by all processes -
so that if a change needs to be made an exterior process can change one
or more
cache entr{y|ies}, and all apache children will then use the new cached
template.

Apart from security of the Shared memory - I see no major issues - but I
be looking through rose tinted specs...

Can any one see any major issues with this from a mod_perl prespective ?

If anyones interested in having a look see - drop me a line - as I'll
have to clear it up a bit !

Greg Cope