Documentation ¶
Index ¶
- Constants
- Variables
- func ClearSession()
- func Init()
- func TimeoutAfter(f func(), timeout time.Duration) error
- func TimeoutAfterWithReturn(f func() (interface{}, error), timeout time.Duration) (rsp interface{}, err error)
- type Lifetime
- type Session
- type Timeout
- func (t *Timeout) Busy(reason string)
- func (t *Timeout) C() <-chan time.Time
- func (t *Timeout) Disable() bool
- func (t *Timeout) DoneBusy(reason string)
- func (t *Timeout) DoneBusyWithReset(ext time.Duration, reason string)
- func (t *Timeout) Enable() bool
- func (t *Timeout) EndInterruption() time.Time
- func (t *Timeout) GetDue() time.Time
- func (t *Timeout) GetEstimateDue(ext time.Duration) time.Time
- func (t *Timeout) Halt()
- func (t *Timeout) Interrupted() time.Duration
- func (t *Timeout) IsBusy() bool
- func (t *Timeout) IsDisabled() bool
- func (t *Timeout) Reset() bool
- func (t *Timeout) ResetWithExtension(ext time.Duration, reason string) bool
- func (t *Timeout) Restart(ext time.Duration)
- func (t *Timeout) SetLogger(log logger.ILogger)
- func (t *Timeout) Since() time.Duration
- func (t *Timeout) Start() time.Time
- func (t *Timeout) StartWithCalibration(startAt time.Time) time.Time
- func (t *Timeout) StartWithDeadline(deadline time.Time) time.Time
- func (t *Timeout) Stop()
Constants ¶
View Source
const TICK_10_ERROR = 2 * time.Millisecond
View Source
const TICK_10_ERROR_EXTEND = 1000 * time.Millisecond
For Lambdas with 1vCPU(1792M) and above.
View Source
const TICK_1_ERROR = 10 * time.Millisecond
View Source
const TICK_1_ERROR_EXTEND = 10000 * time.Millisecond
For Lambdas below 0.5vCPU(896M).
View Source
const TICK_5_ERROR = 10 * time.Millisecond
View Source
const TICK_5_ERROR_EXTEND = 1000 * time.Millisecond
For Lambdas with 0.5vCPU(896M) and above.
View Source
const TICK_EXTENSION = 100 * time.Millisecond
Variables ¶
View Source
var ( TICK = 100 * time.Millisecond TICK_ERROR_EXTEND = TICK_10_ERROR_EXTEND TICK_ERROR = TICK_10_ERROR ErrTimeout = errors.New("timeout") MemoryLimitInMB = 3096 )
View Source
var ( // If immortal, the function will not be reset anytime. Immortal = true )
Functions ¶
func ClearSession ¶
func ClearSession()
func TimeoutAfter ¶
Types ¶
type Lifetime ¶
type Lifetime struct {
// contains filtered or unexported fields
}
Lifetime defines how long a function can survive. It ticks across invocations.
func (*Lifetime) RebornIfDead ¶
func (l *Lifetime) RebornIfDead()
Only reset function's identification if the function has been dead.
type Session ¶
type Session struct { Sid string // Id from proxy Id string // Id from provider Input *protocol.InputEvent Requests int Setup sync.WaitGroup // Used to wait for setup on invocation CleanUp sync.WaitGroup // Used to wait for cleanup on ending invocation Migrator *migrator.Client Timeout *Timeout Connection net.Conn // contains filtered or unexported fields }
func GetOrCreateSession ¶
func GetOrCreateSession() *Session
func GetSession ¶
func GetSession() *Session
func (*Session) DoneLocked ¶
func (s *Session) DoneLocked()
func (*Session) IsMigrating ¶
type Timeout ¶
func (*Timeout) DoneBusyWithReset ¶
func (*Timeout) EndInterruption ¶
func (*Timeout) Interrupted ¶
func (*Timeout) IsDisabled ¶
func (*Timeout) ResetWithExtension ¶
func (*Timeout) StartWithCalibration ¶
func (*Timeout) StartWithDeadline ¶
Click to show internal directories.
Click to hide internal directories.