Skip to content
Snippets Groups Projects
Commit a60bd10c authored by Josh Brooks's avatar Josh Brooks
Browse files

Clean up documentation

parent 330a54cd
No related branches found
No related tags found
3 merge requests!510Release,!381Initial CTIDH,!378Add a debug GetRunningProcesses to bindings
...@@ -136,8 +136,18 @@ func (c *Cmix) IsHealthy() bool { ...@@ -136,8 +136,18 @@ func (c *Cmix) IsHealthy() bool {
return c.api.GetCmix().IsHealthy() return c.api.GetCmix().IsHealthy()
} }
// GetRunningProcesses returns the name of all running processes at the time // GetRunningProcesses returns the names of all running processes at the time
// of this call. // of this call. Note that this list may change and is subject to race
// conditions if multiple threads are in the process of starting or stopping.
//
// Returns:
// - []byte - A JSON marshalled list of all running processes.
//
// JSON Example:
// {
// "FileTransfer{BatchBuilderThread, FilePartSendingThread#0, FilePartSendingThread#1, FilePartSendingThread#2, FilePartSendingThread#3}",
// "MessageReception Worker 0"
// }
func (c *Cmix) GetRunningProcesses() ([]byte, error) { func (c *Cmix) GetRunningProcesses() ([]byte, error) {
return json.Marshal(c.api.GetRunningProcesses()) return json.Marshal(c.api.GetRunningProcesses())
} }
......
...@@ -219,8 +219,8 @@ func (m *manager) StartProcesses() (stoppable.Stoppable, error) { ...@@ -219,8 +219,8 @@ func (m *manager) StartProcesses() (stoppable.Stoppable, error) {
batchBuilderStop := stoppable.NewSingle(batchBuilderThreadStoppable) batchBuilderStop := stoppable.NewSingle(batchBuilderThreadStoppable)
// Start sending threads // Start sending threads
// Note that the startSendingWorkerPool creates go routines for over worker // Note that the startSendingWorkerPool already creates thread for every
// As a result, there is no need to run it asynchronously. In fact, // worker. As a result, there is no need to run it asynchronously. In fact,
// running this asynchronously could result in a race condition where // running this asynchronously could result in a race condition where
// some worker threads are not added to senderPoolStop before that stoppable // some worker threads are not added to senderPoolStop before that stoppable
// is added to the multiStoppable. // is added to the multiStoppable.
...@@ -229,7 +229,6 @@ func (m *manager) StartProcesses() (stoppable.Stoppable, error) { ...@@ -229,7 +229,6 @@ func (m *manager) StartProcesses() (stoppable.Stoppable, error) {
// Create a multi stoppable // Create a multi stoppable
multiStoppable := stoppable.NewMulti(fileTransferStoppable) multiStoppable := stoppable.NewMulti(fileTransferStoppable)
jww.DEBUG.Printf("Adding sender pool w/ name %s", senderPoolStop.Name())
multiStoppable.Add(senderPoolStop) multiStoppable.Add(senderPoolStop)
multiStoppable.Add(batchBuilderStop) multiStoppable.Add(batchBuilderStop)
......
...@@ -76,7 +76,9 @@ func (m *Multi) GetStatus() Status { ...@@ -76,7 +76,9 @@ func (m *Multi) GetStatus() Status {
return lowestStatus return lowestStatus
} }
// GetRunningProcesses returns a list of running Stoppable processes. // GetRunningProcesses returns the names of all running processes at the time
// of this call. Note that this list may change and is subject to race
// conditions if multiple threads are in the process of starting or stopping.
func (m *Multi) GetRunningProcesses() []string { func (m *Multi) GetRunningProcesses() []string {
m.mux.RLock() m.mux.RLock()
......
...@@ -397,8 +397,9 @@ func (c *Cmix) HasRunningProcessies() bool { ...@@ -397,8 +397,9 @@ func (c *Cmix) HasRunningProcessies() bool {
return !c.followerServices.stoppable.IsStopped() return !c.followerServices.stoppable.IsStopped()
} }
// GetRunningProcesses returns the name of all running processes at the time // GetRunningProcesses returns the names of all running processes at the time
// of this call. // of this call. Note that this list may change and is subject to race
// conditions if multiple threads are in the process of starting or stopping.
func (c *Cmix) GetRunningProcesses() []string { func (c *Cmix) GetRunningProcesses() []string {
return c.followerServices.stoppable.GetRunningProcesses() return c.followerServices.stoppable.GetRunningProcesses()
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment