Jose Borges Ferreira:
> On Wed, Jun 18, 2014 at 10:15 PM, Wietse Venema <wie...@porcupine.org> wrote:
> > Each "pipeline:" query is given to the first table. Each table
> > lookup result becomes the query for the next table in the pipeline,
> > and the last table produces the final result.  When any table lookup
> > produces no result, the entire pipeline produces no result.
> 
> That's great!
> Right now I can think a couple weird tricks i have to use on LDAP
> lookups that can be simplified with this.
> 
> Can you consider a similar behavior to allow caching.
> Something like:
> 
>  if ( value = get_table1 () ) {
>     return value
>  } else {
>     value = get_table2();
>     set_table1(value,ttl);
>     return value
> }

Why not implement a cache: maptype that you can prepend to the
source (a pipeline any simple lookup table):

cache:!maptype:mapname!ttl!pipeline...

where maptype:mapname implements persistent storage. This searches
the persistent storage first, and if the item is not found or too
old, invokes the source (pipeline or whatever) and stores a fresh
result.

The only problem is who invokes the cache cleanup operation.

These pseudo tables are fun.

        Wietse

Reply via email to