Hi Henrik,

> I've reviewed the **Ext* part in the manual and I will need something
> different as I will have several nodes on each machine on different ports
> (starting with simply localhost). I suppose I could have simply modified it
> if I had had one node per machine?

With "node" you mean a server process? What makes you think that the
example limits it to one node? IIRC, the example is in fact a simplified
version (perhaps too simplified?) of a system where there were many
servers, of equal and different types, on each host.


> Anyway, what would the whole procedure you've described look like if I have
> two external nodes listening on 4041 and 4042 respectively but on localhost
> both of them, and the E/R in question looks like this?:
> 
> (class +Article +Entity)
> (rel aid       (+Key +Number))
> (rel title     (+String))
> (rel htmlUrl   (+Key +String)) #
> (rel body      (+Blob))
> (rel pubDate   (+Ref +Number))

Side question: Is there a special reason why 'pubDate' is a '+Number'
and not a '+Date'? Should work that way, though.


> In this case I want to fetch article 25 - 50 sorted by pubDate from both
> nodes

Unfortunately, this cannot be achieved directly with an '+Aux' relation,
because the article number and the date cannot be organized into a
single index with a primary and secondary sorting criterion.

There is no other way then fetching and then sorting them, I think:

   (by '((This) (: pubDate)) sort (collect 'aid '+Article 25 50))

Thus, the "send" part from a node to the central server would be

   (for Article
      (by
         '((This) (: pubDate))
         sort
         (collect 'aid '+Article 25 50) )
      (pr Article)         # Send the article object
      (NIL (flush)) )      # Flush the socket

The 'flush' is important, not so much to immediately send the data, but
to detect whether the other side (the central server) has closed the
connection, perhaps because it isn't interested in further data.

'flush' returns NIL if it cannot send the data successfully, and thus
causes the 'for' loop to terminate.



> So as far as I've understood it a (setq *Ext ... ) section is needed and
> then the specific logic described in your previous post in the form of
> something using *ext* or maybe *remote*?

Yes. '*Ext' is necessary if remote objects are accessed locally.

'remote' might be handy if Pilog is used for remote queries. This is not
the case in the above example.

But 'ext' is needed on the central server, with the proper offsets for
the clients. This can be all encapsulated in the +Agent objects.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to