Re: [Zope-dev] Using Queue within a Zope product

2002-01-15 Thread Chris McDonough

> I need to put messages into a queue from within a Zclass, and then get and
> process them from an external long running process.

When you say an external long running process, do you mean that you'll want
to access them from a separate process via something like XML-RPC?  or ZEO?
Or HTTP?  What is your preferred way to get access to the items in the
queue?

> I have created a class which imports a derivative of queue, the class
> instantiates a queue as a class object.  The idea is that the queue will
use
> a persistent object for the queue (list), and then some external process
can
> also use the same object(list) in its queue processing. Both the zclasses
> that inherit from this queue and the external process must use the same
> mutexes...

I dont think you mean external process here, I think you might mean
something else... two processes can not share the same mutex.  Do you maybe
mean thread?

> Questions:
> 1 Should the queue.queue object be made persistent or should we
instantiate
> it with an external list which is the persistent object. Can either of
these
> be done an how.

I think you could probably wrap the Queue class in a persistent wrapper...
that'd work.  Anything that can be pickled can be made persistent, so as
long as the Queue class doesnt have a subobject that can't be pickled, you
can make it persistent.  You'll need to write a Python product to do so (see
the Zope developer's Guide).

> 2. Assuming we can do something like the above what are the considerations
> wrt package distribution.

None, really... if you intend to share just the class data.  If you intend
to share exports of instance data (the queues themselves), not much of an
issue here either... just need to make sure that each Zope you run on has
the Product you create.

HTH,

- C


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Using Queue within a Zope product

2002-01-15 Thread Max Slimmer

I need to put messages into a queue from within a Zclass, and then get and
process them from an external long running process.

I have created a class which imports a derivative of queue, the class
instantiates a queue as a class object.  The idea is that the queue will use
a persistent object for the queue (list), and then some external process can
also use the same object(list) in its queue processing. Both the zclasses
that inherit from this queue and the external process must use the same
mutexes...

Questions:
1 Should the queue.queue object be made persistent or should we instantiate
it with an external list which is the persistent object. Can either of these
be done an how.

2. Assuming we can do something like the above what are the considerations
wrt package distribution.

Max Slimmer
Solutions Architect   eMail: [EMAIL PROTECTED]
Service Development - ECS Office:(707)829-2450
VERITAS Software Inc. Cell:  (707)280-9299



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )