Module siptimer

Module to manage timers, for use in client and server transactions.

Introduced in: 17 Jun 2003 by Fredrik Thulin <ft@it.su.se>

Authors: Fredrik Thulin (ft@it.su.se).

Description

Module to manage timers, for use in client and server transactions. Make it easier to cancel timers and revive them when we get provisional responses etc.

Data Types

siptimer()

siptimer() = #siptimer{}

no description

siptimerlist()

siptimerlist() = #siptimerlist{}

no description

Function Index

add_timer/4 Create a new timer and add it to TimerList.
cancel_all_timers/1 Cancel all siptimers in TimerList.
cancel_timers/2 Cancel a siptimer, return a new TimerList without the cancelled siptimer.
cancel_timers_with_appsignal/2 Cancel all siptimers in TimerList that has an appsignal matching AppSignal.
debugfriendly/1 Format all timers in TimerList into strings suitable for debug logging.
empty/0 Create an empty siptimerlist.
extract/2 Extract elements from a siptimer record().
get_length/1 Return the length of the list of siptimers contained in the siptimerlist record().
get_timer/2 Locate a timer in TimerList whose reference matches Ref.
get_timers_appsignal_matching/2 Locate all timers in TimerList which have their 'appsignal' element matching AppSignal.
reset_timers/2 Reset all timers listed in Timers to their original timeout value.
revive_timer/3 Revive a sip timer.
test_get_appsignals/1 Exported function for use in unit testings of modules using siptimer timers.
timeout2str/1 Give string second representation of Timeout.

Function Details

add_timer/4

add_timer(Timeout, Description, AppSignal, TimerList) -> NewTimerList

Create a new timer and add it to TimerList.

cancel_all_timers/1

cancel_all_timers(TimerList) -> EmptyList

Cancel all siptimers in TimerList.

cancel_timers/2

cancel_timers(T::Timers, TimerList) -> NewTimerList

Cancel a siptimer, return a new TimerList without the cancelled siptimer.

cancel_timers_with_appsignal/2

cancel_timers_with_appsignal(AppSignal, TimerList) -> NewTimerList

Cancel all siptimers in TimerList that has an appsignal matching AppSignal.

debugfriendly/1

debugfriendly(TimerList) -> [string()]

Format all timers in TimerList into strings suitable for debug logging.

empty/0

empty() -> NewTimerList

Create an empty siptimerlist.

extract/2

extract(Values, SipTimer) -> [term()]

Extract elements from a siptimer record().

get_length/1

get_length(TimerList) -> Len

Return the length of the list of siptimers contained in the siptimerlist record().

get_timer/2

get_timer(Ref, TimerList) -> #siptimer{} | none

Locate a timer in TimerList whose reference matches Ref.

get_timers_appsignal_matching/2

get_timers_appsignal_matching(AppSignal, TimerList) -> [#siptimer{}]

Locate all timers in TimerList which have their 'appsignal' element matching AppSignal.

reset_timers/2

reset_timers(T::Timers, TimerList) -> NewTimerList

Reset all timers listed in Timers to their original timeout value.

revive_timer/3

revive_timer(SipTimer, NewTimeout, TimerList) -> NewTimerList

Revive a sip timer. This means we start a new timer with the same parameters as the old one, but with a new timeout value. Don't revive a timer that hasn't fired or you will have two timers that might fire!

test_get_appsignals/1

test_get_appsignals(TimerList) -> AppSignals

Exported function for use in unit testings of modules using siptimer timers. Returns just the appsignals from the timers in TimerList, in fixed order of which timers would fire first.

timeout2str/1

timeout2str(Timeout) -> TStr

Give string second representation of Timeout.


Generated by EDoc, Oct 17 2007, 16:48:27.