<s> from cacheback . base import Job <EOL> from dummyapp import models <EOL> class VanillaJob ( Job ) : <EOL> fetch_on_miss = False <EOL> refresh_timeout = <NUM_LIT:5> <EOL> def fetch ( self ) : <EOL> import time <EOL> time . sleep ( <NUM_LIT:10> ) <EOL> return models . DummyModel . objects . all ( ) <EOL> class KeyedJob ( Job ) : <EOL> lifetime = <NUM_LIT:5> <EOL> fetch_on_stale_threshold = <NUM_LIT:10> <EOL> def key ( self , name ) : <EOL> return name <EOL> def fetch ( self , name ) : <EOL> return models . DummyModel . objects . filter ( name = name ) </s>
