Skip to content

Commit

Permalink
Added locked generator documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bobvandevijver authored Jan 17, 2020
1 parent 6df3727 commit 15c85e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Resources/doc/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class DefaultController Extends Controller{
$latex->addElement(new TitlePage('BobV Latex Test', 'a subtitle', 'an author', '\today'));
$latex->addElement(new TOC());

// Or, when using autowiring, the interface LatexGeneratorInterface can be used
$latexGenerator = $this->get('bobv.latex.generator');

// Return a PDF Response from a LaTeX object
Expand Down Expand Up @@ -185,6 +186,8 @@ public function renderLatex(LatexGeneratorInterface $generator){
}
```

If you're in need of ensuring only a single latex generator can run at the same time, you can use the `LockedLatexGenerator` (alias `bobv.latex.generator.locked`). This service behaves exactly the same as the normal generator, but it requires you to call the `acquireLock` method before calling any generate method. You can release the lock afterward by calling `releaseLock`, or it will be released automatically when the HTTP request is finished.

### 5. Caching

By default, this latexbundle will not dump the texfile or regenerate the PDF file if the file already exists. This is done by using a hash of the tex contents to ensure that when a file is changed, the generation will be done always.
Expand Down

0 comments on commit 15c85e8

Please sign in to comment.