[web-devel] Application context?

Michael Snoyman michael at snoyman.com
Thu Feb 17 22:06:20 CET 2011


If I'm understanding you properly, I think the correct approach is to
put a mutable variable in your foundation datatype. I've put up an
example on Github[1].

Michael

[1] https://github.com/snoyberg/haskell-web-rosetta/blob/master/counter/yesod.hs

On Thu, Feb 17, 2011 at 10:40 PM, Petter Egesund
<petter.egesund at gmail.com> wrote:
> Hi and thanks for writing such cool software!
>
> I am wondering about how to deal with a problem which is releated to
> what is called application-context in some other web-frameworks.
>
> The problem is like this:
>
> 1) I would like to do some calculations and put the results in a
> judy-table (or a regular hash-table)
> 2) I would like to serve results from this calculations in yesod.
>
> So how do I pass my hash as a parameter to functions which is serving content?
>
> I was thinking about changing the yesod-code and copy some of the
> handling from sessions and/or databasehandlers, but it did not seem
> right - I do not want to maintain my own branch.
>
> Is there a better way to do this?
>
> Cheers,
>
> Petter
>
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
>



More information about the web-devel mailing list