A cache handler that simply stores the token info in memory as an instance attribute of this class. The token info will be lost when this instance is freed.
| 103 | |
| 104 | |
| 105 | class MemoryCacheHandler(CacheHandler): |
| 106 | """ |
| 107 | A cache handler that simply stores the token info in memory as an |
| 108 | instance attribute of this class. The token info will be lost when this |
| 109 | instance is freed. |
| 110 | """ |
| 111 | |
| 112 | def __init__(self, token_info=None): |
| 113 | """ |
| 114 | Parameters: |
| 115 | * token_info: The token info to store in memory. Can be None. |
| 116 | """ |
| 117 | self.token_info = token_info |
| 118 | |
| 119 | def get_cached_token(self): |
| 120 | return self.token_info |
| 121 | |
| 122 | def save_token_to_cache(self, token_info): |
| 123 | self.token_info = token_info |
| 124 | |
| 125 | |
| 126 | class DjangoSessionCacheHandler(CacheHandler): |
no outgoing calls
searching dependent graphs…