Documentation
Preparing search index...
rivetkit
driver-helpers/mod
ActorInstance
Interface ActorInstance<S, CP, CS, V, I, DB>
interface
ActorInstance
<
S
,
CP
,
CS
,
V
,
I
,
DB
extends
AnyDatabaseProvider
>
{
actorContext
:
ActorContext
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
;
connectionManager
:
ConnectionManager
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
;
driver
:
ActorDriver
;
eventManager
:
EventManager
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
;
get
abortSignal
()
:
AbortSignal
;
get
actions
()
:
string
[]
;
get
config
()
:
ActorConfig
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
;
get
conns
()
:
Map
<
string
,
Conn
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
>
;
get
connStateEnabled
()
:
boolean
;
get
db
()
:
InferDatabaseClient
<
DB
>
;
get
id
()
:
string
;
get
inlineClient
()
:
Client
<
Registry
<
any
>
>
;
get
inspector
()
:
ActorInspector
;
get
inspectorToken
()
:
string
|
undefined
;
get
isStopping
()
:
boolean
;
get
key
()
:
string
[]
;
get
log
()
:
Logger
;
get
name
()
:
string
;
get
persist
()
:
PersistedActor
<
S
,
CP
,
CS
,
I
>
;
get
region
()
:
string
;
get
rLog
()
:
Logger
;
get
schedule
()
:
Schedule
;
get
state
()
:
S
;
set
state
(
value
:
S
)
:
void
;
get
stateEnabled
()
:
boolean
;
get
vars
()
:
V
;
assertReady
(
allowStoppingState
?:
boolean
)
:
void
;
beginHonoHttpRequest
()
:
void
;
endHonoHttpRequest
()
:
void
;
executeAction
(
ctx
:
ActionContext
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
,
actionName
:
string
,
args
:
unknown
[]
,
)
:
Promise
<
unknown
>
;
handleRawRequest
(
conn
:
Conn
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
,
request
:
Request
,
)
:
Promise
<
Response
>
;
handleRawWebSocket
(
conn
:
Conn
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
,
websocket
:
UniversalWebSocket
,
request
?:
Request
,
)
:
void
;
isReady
()
:
boolean
;
onAlarm
()
:
Promise
<
void
>
;
onStop
()
:
Promise
<
void
>
;
processMessage
(
message
:
{
body
:
|
{
tag
:
"ActionRequest"
;
val
:
{
args
:
unknown
;
id
:
bigint
;
name
:
string
}
;
}
|
{
tag
:
"SubscriptionRequest"
;
val
:
{
eventName
:
string
;
subscribe
:
boolean
}
;
}
;
}
,
conn
:
Conn
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
,
)
:
Promise
<
void
>
;
resetSleepTimer
()
:
void
;
saveState
(
opts
:
SaveStateOptions
)
:
Promise
<
void
>
;
scheduleEvent
(
timestamp
:
number
,
action
:
string
,
args
:
unknown
[]
,
)
:
Promise
<
void
>
;
start
(
actorDriver
:
ActorDriver
,
inlineClient
:
Client
<
Registry
<
any
>
>
,
actorId
:
string
,
name
:
string
,
key
:
string
[]
,
region
:
string
,
)
:
Promise
<
void
>
;
startSleep
()
:
void
;
waitUntil
(
promise
:
Promise
<
void
>
)
:
void
;
}
Type Parameters
S
CP
CS
V
I
DB
extends
AnyDatabaseProvider
Index
Properties
actor
Context
connection
Manager
driver
event
Manager
Accessors
abort
Signal
actions
config
conns
conn
State
Enabled
db
id
inline
Client
inspector
inspector
Token
is
Stopping
key
log
name
persist
region
r
Log
schedule
state
state
Enabled
vars
Methods
assert
Ready
begin
Hono
Http
Request
end
Hono
Http
Request
execute
Action
handle
Raw
Request
handle
Raw
Web
Socket
is
Ready
on
Alarm
on
Stop
process
Message
reset
Sleep
Timer
save
State
schedule
Event
start
start
Sleep
wait
Until
Properties
actor
Context
actorContext
:
ActorContext
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
connection
Manager
connectionManager
:
ConnectionManager
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
driver
driver
:
ActorDriver
event
Manager
eventManager
:
EventManager
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
Accessors
abort
Signal
get
abortSignal
()
:
AbortSignal
Returns
AbortSignal
actions
get
actions
()
:
string
[]
Returns
string
[]
config
get
config
()
:
ActorConfig
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
Returns
ActorConfig
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
conns
get
conns
()
:
Map
<
string
,
Conn
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
>
Returns
Map
<
string
,
Conn
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
>
conn
State
Enabled
get
connStateEnabled
()
:
boolean
Returns
boolean
db
get
db
()
:
InferDatabaseClient
<
DB
>
Returns
InferDatabaseClient
<
DB
>
id
get
id
()
:
string
Returns
string
inline
Client
get
inlineClient
()
:
Client
<
Registry
<
any
>
>
Returns
Client
<
Registry
<
any
>
>
inspector
get
inspector
()
:
ActorInspector
Returns
ActorInspector
inspector
Token
get
inspectorToken
()
:
string
|
undefined
Returns
string
|
undefined
is
Stopping
get
isStopping
()
:
boolean
Returns
boolean
key
get
key
()
:
string
[]
Returns
string
[]
log
get
log
()
:
Logger
Returns
Logger
name
get
name
()
:
string
Returns
string
persist
get
persist
()
:
PersistedActor
<
S
,
CP
,
CS
,
I
>
Returns
PersistedActor
<
S
,
CP
,
CS
,
I
>
region
get
region
()
:
string
Returns
string
r
Log
get
rLog
()
:
Logger
Returns
Logger
schedule
get
schedule
()
:
Schedule
Returns
Schedule
state
get
state
()
:
S
Returns
S
set
state
(
value
:
S
)
:
void
Parameters
value
:
S
Returns
void
state
Enabled
get
stateEnabled
()
:
boolean
Returns
boolean
vars
get
vars
()
:
V
Returns
V
Methods
assert
Ready
assertReady
(
allowStoppingState
?:
boolean
)
:
void
Parameters
allowStoppingState
:
boolean
= false
Returns
void
begin
Hono
Http
Request
beginHonoHttpRequest
()
:
void
Returns
void
end
Hono
Http
Request
endHonoHttpRequest
()
:
void
Returns
void
execute
Action
executeAction
(
ctx
:
ActionContext
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
,
actionName
:
string
,
args
:
unknown
[]
,
)
:
Promise
<
unknown
>
Parameters
ctx
:
ActionContext
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
actionName
:
string
args
:
unknown
[]
Returns
Promise
<
unknown
>
handle
Raw
Request
handleRawRequest
(
conn
:
Conn
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
,
request
:
Request
,
)
:
Promise
<
Response
>
Parameters
conn
:
Conn
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
request
:
Request
Returns
Promise
<
Response
>
handle
Raw
Web
Socket
handleRawWebSocket
(
conn
:
Conn
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
,
websocket
:
UniversalWebSocket
,
request
?:
Request
,
)
:
void
Parameters
conn
:
Conn
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
websocket
:
UniversalWebSocket
Optional
request
:
Request
Returns
void
is
Ready
isReady
()
:
boolean
Returns
boolean
on
Alarm
onAlarm
()
:
Promise
<
void
>
Returns
Promise
<
void
>
on
Stop
onStop
()
:
Promise
<
void
>
Returns
Promise
<
void
>
process
Message
processMessage
(
message
:
{
body
:
|
{
tag
:
"ActionRequest"
;
val
:
{
args
:
unknown
;
id
:
bigint
;
name
:
string
}
;
}
|
{
tag
:
"SubscriptionRequest"
;
val
:
{
eventName
:
string
;
subscribe
:
boolean
}
;
}
;
}
,
conn
:
Conn
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
,
)
:
Promise
<
void
>
Parameters
message
:
{
body
:
|
{
tag
:
"ActionRequest"
;
val
:
{
args
:
unknown
;
id
:
bigint
;
name
:
string
}
;
}
|
{
tag
:
"SubscriptionRequest"
;
val
:
{
eventName
:
string
;
subscribe
:
boolean
}
;
}
;
}
conn
:
Conn
<
S
,
CP
,
CS
,
V
,
I
,
DB
>
Returns
Promise
<
void
>
reset
Sleep
Timer
resetSleepTimer
()
:
void
Returns
void
save
State
saveState
(
opts
:
SaveStateOptions
)
:
Promise
<
void
>
Parameters
opts
:
SaveStateOptions
Returns
Promise
<
void
>
schedule
Event
scheduleEvent
(
timestamp
:
number
,
action
:
string
,
args
:
unknown
[]
)
:
Promise
<
void
>
Parameters
timestamp
:
number
action
:
string
args
:
unknown
[]
Returns
Promise
<
void
>
start
start
(
actorDriver
:
ActorDriver
,
inlineClient
:
Client
<
Registry
<
any
>
>
,
actorId
:
string
,
name
:
string
,
key
:
string
[]
,
region
:
string
,
)
:
Promise
<
void
>
Parameters
actorDriver
:
ActorDriver
inlineClient
:
Client
<
Registry
<
any
>
>
actorId
:
string
name
:
string
key
:
string
[]
region
:
string
Returns
Promise
<
void
>
start
Sleep
startSleep
()
:
void
Returns
void
wait
Until
waitUntil
(
promise
:
Promise
<
void
>
)
:
void
Parameters
promise
:
Promise
<
void
>
Returns
void
Settings
Member Visibility
Protected
Inherited
Theme
OS
Light
Dark
On This Page
Properties
actor
Context
connection
Manager
driver
event
Manager
Accessors
abort
Signal
actions
config
conns
conn
State
Enabled
db
id
inline
Client
inspector
inspector
Token
is
Stopping
key
log
name
persist
region
r
Log
schedule
state
state
Enabled
vars
Methods
assert
Ready
begin
Hono
Http
Request
end
Hono
Http
Request
execute
Action
handle
Raw
Request
handle
Raw
Web
Socket
is
Ready
on
Alarm
on
Stop
process
Message
reset
Sleep
Timer
save
State
schedule
Event
start
start
Sleep
wait
Until
Documentation
Loading...