Skip to content

Commit

Permalink
naming convention in razor module
Browse files Browse the repository at this point in the history
  • Loading branch information
ademar committed Mar 7, 2015
1 parent 421b506 commit eb0d8e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Suave.Razor/Library.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ open RazorEngine

module Razor =

let private async_memoize f =
let private asyncMemoize f =
let cache = Collections.Concurrent.ConcurrentDictionary<_ , _>()
fun x ->
async {
Expand All @@ -26,15 +26,15 @@ module Razor =
return res
}

let private load_template template_path =
let private loadTemplate template_path =
async {
use file = new FileStream(template_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
use reader = new StreamReader(file)
let! razorTemplate = reader.ReadToEndAsync()
return razorTemplate
}

let load_template_cached = async_memoize load_template
let loadTemplateCached = asyncMemoize loadTemplate

/// razor WebPart
///
Expand All @@ -48,7 +48,7 @@ module Razor =
async {
try
let template_path = resolvePath r.runtime.homeDirectory path
let! razorTemplate = load_template_cached template_path
let! razorTemplate = loadTemplateCached template_path
let content = Razor.Parse(razorTemplate, model, template_path)
return! Response.response HTTP_200 (UTF8.bytes content) r
with
Expand Down

0 comments on commit eb0d8e2

Please sign in to comment.