From 87e44fcebae4be5ba25d238853c646c230af00aa Mon Sep 17 00:00:00 2001 From: michaeloffner Date: Fri, 7 Jun 2024 00:27:33 +0200 Subject: [PATCH] improve md --- docs/recipes/gateways-overview.md | 16 ++++++++-------- docs/recipes/loop_through_files.md | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/recipes/gateways-overview.md b/docs/recipes/gateways-overview.md index 96ce18460..3bb2ebc9a 100644 --- a/docs/recipes/gateways-overview.md +++ b/docs/recipes/gateways-overview.md @@ -16,7 +16,7 @@ ] } --> -## How does an Event Gateway work? +# How does an Event Gateway work? An event gateway is a background process that continuously runs. @@ -26,11 +26,11 @@ This looping and sleeping does not count for all types of event gateways. For ex This "doing what it is designed for" will be explained in more detail underneath. -## Which gateways are available? +# Which gateways are available? Lucee comes with 2 gateways: a Directory watcher and a Mail watcher. -### Directory watcher +## Directory watcher This event gateway checks a given directory for file changes. These changes (events) can be: @@ -44,7 +44,7 @@ Please note that the files in this first snapshot are NOT seen as changes! So if you already have some files in the directory you want to watch, these files are not seen as "new file" when the gateway starts. Also, when Lucee (or your whole server) restarts, any changes which happened within this time are not seen and will not be picked up when the Directory watcher starts up again. -### Filters +## Filters You can apply filters for what you exactly want to watch changes for: @@ -53,11 +53,11 @@ You can apply filters for what you exactly want to watch changes for: Note: the Extensions setting might be changed in the near future, due to an enhancement request. -### Mail watcher +## Mail watcher This gateway checks a given POP mailbox for new mail. Since it only checks for new mail, it is rather limited in what it can do, but this is what makes it fast. The Mail watcher will read the inbox, and then check all the emails found. -### Logs +## Logs Make sure you regularly check the logs, because when anything goes wrong, Lucee will report this in its logs. @@ -90,7 +90,7 @@ For example, the above code would crash if a file with the same name already exi It might be even wiser to just email the complete error dump, so you will be semi-instantly notified of any errors. -### Using cfadmin with Event gateways +## Using cfadmin with Event gateways Instead of using the server/web admin, you can also use Lucee's `` tag. @@ -116,7 +116,7 @@ Add or update a gateway instance: /> ``` -### Remove a gateway instance +## Remove a gateway instance ```lucee -## Looping Through File ## +# Looping Through File This document explains how to handle big files in Lucee in a better way. The classic way that you are familiar with uses cffile tag, fileRead, and fileReadBinary functions to read the file into memory. This is a simple solution, but it consumes a lot of memory. -### Example: Handle files with cffile tag, fileRead, and fileReadBinary functions +## Example: Handle files with cffile tag, fileRead, and fileReadBinary functions ```luceescript include "_getPath2BigFile.cfm"; @@ -43,7 +43,7 @@ In the example above, It consumes a lot of memory. -### Use Loop - File +## Use Loop - File Use cfloop file. It allows you to read a file line by line, so you do not have to load an entire file into memory. You only load a line at a time into the memory. @@ -51,7 +51,7 @@ Use cfloop file. It allows you to read a file line by line, so you do not have t ``` -### Example Using Loop +## Example Using Loop ```luceescript include "_getPath2BigFile.cfm"; @@ -64,7 +64,7 @@ function handle(line) {} In the above example, loop through the file and get each line, so in memory there is only ever the one line. This is not only faster, it also consumes less memory. -### Footnotes +## Footnotes Here you can see the above details in a video: