Module z_sites_dispatcher

Server for matching the request path to correct site and dispatch rule.

Copyright 2009-2013 Marc Worrell

Behaviours: gen_server.

Authors: Marc Worrell (marc@worrell.nl).

Description

Server for matching the request path to correct site and dispatch rule.

Data Types

dispatch()

dispatch() = {no_dispatch_match, _UnmatchedHost, _UnmatchedPathTokens} | {Mod, ModOpts, HostTokens, Port, PathTokens, Bindings, AppRoot, StringPath} | handled

Function Index

code_change/3Convert process state when code is changed.
dispatch/3Match the host and path to a dispatch rule.
dispatch/4
get_fallback_site/0Retrieve the fallback site.
get_host_for_domain/1Fetch the host handling the given domain name.
handle_call/3Match a host/path to the dispatch rules.
handle_cast/2Reloads the dispatch rules.
handle_info/2Handling all non call/cast messages.
init/1Initiates the server.
start_link/0Starts the server.
start_link/1
terminate/2This function is called by a gen_server when it is about to terminate.
update_dispatchinfo/0Update the webmachine dispatch information.

Function Details

code_change/3

code_change(OldVsn, State, Extra) -> {ok, NewState}

Convert process state when code is changed

dispatch/3

dispatch(Host::string() | atom(), Path::string(), ReqData::wm_reqdata) -> {dispatch(), NewReqData}

Match the host and path to a dispatch rule.

dispatch/4

dispatch(Host, Path, ReqData, TracerPid) -> any()

get_fallback_site/0

get_fallback_site() -> any()

Retrieve the fallback site.

get_host_for_domain/1

get_host_for_domain(Domain) -> any()

Fetch the host handling the given domain name

handle_call/3

handle_call(Dispatch::Request, From, State) -> {reply, Reply, State} | {reply, Reply, State, Timeout} | {noreply, State} | {noreply, State, Timeout} | {stop, Reason, Reply, State} | {stop, Reason, State}

Match a host/path to the dispatch rules. Return a match result, a no_dispatch_match tuple or no_host_match

handle_cast/2

handle_cast(Message::Msg, State) -> {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}

Reloads the dispatch rules.

handle_info/2

handle_info(Info, State) -> any()

Handling all non call/cast messages

init/1

init(Args) -> {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}

Initiates the server.

start_link/0

start_link() -> {ok, Pid} | ignore | {error, Error}

Starts the server

start_link/1

start_link(Args) -> any()

terminate/2

terminate(Reason, State) -> void()

This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.

update_dispatchinfo/0

update_dispatchinfo() -> any()

Update the webmachine dispatch information. Collects dispatch information from all sites and sends it to webmachine for updating its dispatch lists and host information.


Generated by EDoc, Aug 20 2014, 12:08:05.