Skip to content

Commit

Permalink
reset process func and isStarted (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM authored Aug 30, 2024
1 parent e073571 commit 2f59656
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions datastreamer/streamclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,23 @@ func (c *StreamClient) SetProcessEntryFunc(f ProcessEntryFunc) {
c.setProcessEntryFunc(f, nil)
}

// ResetProcessEntryFunc resets the callback function to the default one
func (c *StreamClient) ResetProcessEntryFunc() {
// Set default callback function to process entry
c.setProcessEntryFunc(PrintReceivedEntry, c.relayServer)
}

// setProcessEntryFunc sets the callback function to process entry with server parameter
func (c *StreamClient) setProcessEntryFunc(f ProcessEntryFunc, s *StreamServer) {
c.processEntry = f
c.relayServer = s
}

// IsStarted returns if the client is started
func (c *StreamClient) IsStarted() bool {
return c.started
}

// PrintReceivedEntry prints received entry (default callback function)
func PrintReceivedEntry(e *FileEntry, c *StreamClient, s *StreamServer) error {
// Log data entry fields
Expand Down

0 comments on commit 2f59656

Please sign in to comment.