Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -module(content).
- -export([get/1, locate/2]).
- -define(cached, []).
- get(content) ->
- % receive tcp signal asking for content
- try locate_content(cached, content) of
- {etag, l_content} when length(etag) > 0 ->
- % send HTTP response with the content
- merge(cached, [{gen_etag(l_content), l_content}]);
- %socket(content).
- catch
- Empty ->
- io:fwrite("Content not found");
- end.
- locate(content, index = 0) ->
- Result = Empty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement