Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching and thread safety (largeish) #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Jun 18, 2015

  1. support Pybars 0.8+ which raises a PybarsError now instead of a KeyEr…

    …ror on partials not found
    schuyler1d committed Jun 18, 2015
    Configuration menu
    Copy the full SHA
    58b7e42 View commit details
    Browse the repository at this point in the history
  2. This is a large-ish patch that adds thread locks where necessary and …

    …precompilation support
    
    It is organized as follows:
    * In anticipation of Django 1.8 template engine support, it creates a new file template/backends.py
      with a Handlebars engine structured for the Django 1.8 api (though missing some parts for full support)
    * In backends.py there is also a CompiledTemplate which is subclassed from template.base.HandlebarsTemplate
    * HandlbarsTemplate and BaseHandlebarsLoader are tweaked to leverage the code in backends.Handlebars.
    * loader.reset_loaders is a new method, which helps testing
    * loaders.filesystem.CachedLoader is mostly separate, but also helps keep template compilations in cache and reusable for future requests.
    
    This is meant to gesture towards the following goals:
    * maintaining backwards compatibility
    * moving towards support for Django 1.8
    * allowing djangobars to be used in a multi-threaded environment
    
    Originally, I separated the thread safety and precompilation as projects, but in
    production, we found that locking threads, still blocks too many requests, so
    they are really necessary combined, at least, in practice.
    schuyler1d committed Jun 18, 2015
    Configuration menu
    Copy the full SHA
    13c50f8 View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2015

  1. Configuration menu
    Copy the full SHA
    10d3878 View commit details
    Browse the repository at this point in the history