Copyright © 2009-2020 Marc Worrell, Maas-Maarten Zeeman
Behaviours: gen_server.
Authors: Marc Worrell (marc@worrell.nl).
cleanup_tsv_text/1 | |
code_change/3 | Convert process state when code is changed. |
define_custom_pivot/3 | Let a module define a custom pivot columns() -> [column()] column() -> {ColumName::atom(), ColSpec::string()} | {atom(), string(), options::list()}. |
delete_task/3 | |
delete_task/4 | |
delete_tasks/1 | |
get_pivot_title/1 | |
get_pivot_title/2 | Fetch the first title from the record for sorting. |
get_task/1 | |
get_task/2 | |
get_task/3 | |
get_task/4 | |
handle_call/3 | Handle task_done messages from task queue jobs. |
handle_cast/2 | Poll the queue for the default host. |
handle_info/2 | Handling all non call/cast messages. |
init/1 | Initiates the server. |
insert_queue/2 | Insert a rsc_id in the pivot queue. |
insert_task/3 | Insert a slow running pivot task. |
insert_task/4 | Insert a slow running pivot task. |
insert_task/5 | Insert a slow running pivot task with unique key and arguments. |
insert_task_after/6 | Insert a slow running pivot task with unique key and arguments that should start after Seconds seconds. |
list_tasks/1 | |
lookup_custom_pivot/4 | Lookup a custom pivot; give back the Id based on a column. |
pg_lang/1 | Translate a language to a language string as used by postgresql. |
pg_lang_extra/1 | |
pivot/2 | An immediate pivot request for a resource. |
pivot_delay/1 | Delay the next pivot, useful when performing big updates. |
pivot_resource_update/4 | Return a modified property list with fields that need immediate pivoting on an update. |
poll/1 | Poll the pivot queue for the database in the context. |
queue_all/1 | Rebuild the search index by queueing all resources for pivot. |
queue_count/1 | Return the length of the pivot queue. |
start_link/1 | Starts the server. |
status/1 | |
stemmer_language/1 | Return the language used for stemming the full text index. |
stemmer_language_config/1 | |
terminate/2 | This function is called by a gen_server when it is about to terminate. |
cleanup_tsv_text(Text::binary()) -> binary()
code_change(OldVsn, State, Extra) -> any()
Convert process state when code is changed
define_custom_pivot(Module, Columns::columns(), Context) -> ok
Let a module define a custom pivot columns() -> [column()] column() -> {ColumName::atom(), ColSpec::string()} | {atom(), string(), options::list()}
delete_task(Module::module(), Function::atom(), Context::z:context()) -> non_neg_integer()
delete_task(Module::module(), Function::atom(), UniqueKey::term(), Context::z:context()) -> non_neg_integer()
delete_tasks(Context::z:context()) -> non_neg_integer()
get_pivot_title(Props) -> any()
get_pivot_title(Id, Context) -> any()
Fetch the first title from the record for sorting.
get_task(Context::z:context()) -> {ok, [map()]} | {error, term()}
get_task(Module::module(), Context::z:context()) -> {ok, [map()]} | {error, term()}
get_task(Module::module(), Function::atom(), Context::z:context()) -> {ok, [map()]} | {error, term()}
get_task(Module::module(), Function::atom(), UniqueKey::binary() | string(), Context::z:context()) -> {ok, map()} | {error, term()}
handle_call(Message, From, State) -> any()
Handle task_done messages from task queue jobs
handle_cast(Message, State) -> any()
Poll the queue for the default host
handle_info(Info, State) -> any()
Handling all non call/cast messages
init(Site::Args) -> {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}
Initiates the server.
insert_queue(IdorIds::m_rsc:resource_id() | [m_rsc:resource_id()], Context::z:context()) -> ok | {error, eexist}
Insert a rsc_id in the pivot queue
insert_task(Module, Function, Context) -> any()
Insert a slow running pivot task. For example syncing category numbers after an category update.
insert_task(Module, Function, UniqueKey, Context) -> any()
Insert a slow running pivot task. Use the UniqueKey to prevent double queued tasks.
insert_task(Module, Function, UniqueKey, Args, Context) -> any()
Insert a slow running pivot task with unique key and arguments.
insert_task_after(SecondsOrDate, Module, Function, UniqueKey, ArgsFun, Context) -> any()
Insert a slow running pivot task with unique key and arguments that should start after Seconds seconds. Always delete any existing transaction, to prevent race conditions when the task is running during this insert.
list_tasks(Context::z:context()) -> {ok, [map()]} | {error, term()}
lookup_custom_pivot(Module, Column, Value, Context) -> Id | undefined
Lookup a custom pivot; give back the Id based on a column. Will always return the first Id found.
pg_lang(X1) -> any()
Translate a language to a language string as used by postgresql. This language list is the intersection of the default catalogs of postgres with the languages supported by mod_translation.
pg_lang_extra(LangCode) -> any()
pivot(Id::integer(), Context::#context{}) -> ok
An immediate pivot request for a resource
pivot_delay(Context::#context{}) -> ok
Delay the next pivot, useful when performing big updates
pivot_resource_update(Id, UpdateProps, RawProps, Context) -> any()
Return a modified property list with fields that need immediate pivoting on an update.
poll(Context) -> void()
Poll the pivot queue for the database in the context
queue_all(Context) -> any()
Rebuild the search index by queueing all resources for pivot.
queue_count(Context::z:context()) -> integer()
Return the length of the pivot queue.
start_link(SiteProps) -> {ok, Pid} | ignore | {error, Error}
Starts the server
status(Context::z:context()) -> {ok, map()} | {error, term()}
stemmer_language(Context::#context{}) -> string()
Return the language used for stemming the full text index. We use a single stemming to prevent having seperate indexes per language.
stemmer_language_config(Context::#context{}) -> atom()
terminate(Reason, State) -> any()
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.
Generated by EDoc