Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xxdk-wasm
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
xxdk-wasm
Commits
da81ed1b
Commit
da81ed1b
authored
2 years ago
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Fix documentation
parent
568f76cb
No related branches found
No related tags found
1 merge request
!60
Revert "Fail a test to be sure it works"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wasm/dummy.go
+16
-7
16 additions, 7 deletions
wasm/dummy.go
with
16 additions
and
7 deletions
wasm/dummy.go
+
16
−
7
View file @
da81ed1b
...
...
@@ -65,14 +65,18 @@ func NewDummyTrafficManager(_ js.Value, args []js.Value) any {
return
newDummyTrafficJS
(
dt
)
}
// Pause will pause the [DummyTraffic]'s sending thread, meaning messages will
no
// longer be sent. After calling Pause, the sending thread may only be
resumed
// by calling Resume.
// Pause will pause the [DummyTraffic]'s sending thread, meaning messages will
//
no
longer be sent. After calling Pause, the sending thread may only be
//
resumed
by calling Resume.
//
// There may be a small delay between this call and the pause taking effect.
// This is because Pause will not cancel the thread when it is in the process
// of sending messages, but will instead wait for that thread to complete. The
// thread will then be prevented from beginning another round of sending.
//
// Returns:
// - Throws a TypeError if it fails to send a pause signal to the sending
// thread.
func
(
dt
*
DummyTraffic
)
Pause
(
js
.
Value
,
[]
js
.
Value
)
any
{
err
:=
dt
.
api
.
Pause
()
if
err
!=
nil
{
...
...
@@ -83,14 +87,19 @@ func (dt *DummyTraffic) Pause(js.Value, []js.Value) any {
return
nil
}
// Start will start up the [DummyTraffic]'s sending thread, meaning messages will
// be sent. This should be called after calling NewManager, as by default the
// thread is paused. This may also be called after a call to [DummyTraffic.Pause].
// Start will start up the [DummyTraffic]'s sending thread, meaning messages
// will be sent. This should be called after calling [NewDummyTrafficManager],
// by default the thread is paused. This may also be called after a call to
// [DummyTraffic.Pause].
//
// This will re-initialize the sending thread with a new randomly generated
// interval between sending dummy messages. This means that there is zero
// guarantee that the sending interval prior to pausing will be the same
// sending interval after a call to Start.
//
// Returns:
// - Throws a TypeError if it fails to send a start signal to the sending
// thread.
func
(
dt
*
DummyTraffic
)
Start
(
js
.
Value
,
[]
js
.
Value
)
any
{
err
:=
dt
.
api
.
Start
()
if
err
!=
nil
{
...
...
@@ -107,7 +116,7 @@ func (dt *DummyTraffic) Start(js.Value, []js.Value) any {
// [DummyTraffic.Pause] for more details)
//
// Returns:
// -
bool -
Returns true ([dummy.Running]) if the sending thread is sending
// - Returns true ([dummy.Running]) if the sending thread is sending
// messages and false ([dummy.Paused]) if the sending thread is not sending
// messages.
func
(
dt
*
DummyTraffic
)
GetStatus
(
js
.
Value
,
[]
js
.
Value
)
any
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment