mirror of
https://gitee.com/rulego/streamsql.git
synced 2026-04-07 04:52:48 +00:00
增加同步的获取结果的方法
This commit is contained in:
@@ -338,6 +338,20 @@ func (s *Streamsql) AddSink(sink func([]map[string]interface{})) {
|
||||
}
|
||||
}
|
||||
|
||||
// AddSyncSink directly adds synchronous result processing callback functions.
|
||||
// Convenience wrapper for Stream().AddSyncSink() for cleaner API calls.
|
||||
//
|
||||
// Parameters:
|
||||
// - sink: Result processing function, receives []map[string]interface{} type result data
|
||||
//
|
||||
// Note: Sync sinks are executed sequentially in the result processing goroutine.
|
||||
// Use this when order of execution matters.
|
||||
func (s *Streamsql) AddSyncSink(sink func([]map[string]interface{})) {
|
||||
if s.stream != nil {
|
||||
s.stream.AddSyncSink(sink)
|
||||
}
|
||||
}
|
||||
|
||||
// PrintTable prints results to console in table format, similar to database output.
|
||||
// Displays column names first, then data rows.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user