mirror of
https://github.com/aljazceru/crawler_v2.git
synced 2025-12-17 23:44:27 +01:00
applying this pattern to all function arguments
1. context 2. config (if any) 3. channel it reads from ... N. (last) the forward function
This commit is contained in:
@@ -89,7 +89,7 @@ func main() {
|
||||
|
||||
go func() {
|
||||
defer producers.Done()
|
||||
pipe.Recorder(ctx, db, recorderQueue, pipe.Send(engineQueue))
|
||||
pipe.Recorder(ctx, recorderQueue, db, pipe.Send(engineQueue))
|
||||
}()
|
||||
|
||||
go func() {
|
||||
@@ -106,7 +106,7 @@ func main() {
|
||||
consumers.Add(1)
|
||||
go func() {
|
||||
defer consumers.Done()
|
||||
pipe.Engine(ctx, config.Engine, store, db, engineQueue)
|
||||
pipe.Engine(ctx, config.Engine, engineQueue, store, db)
|
||||
}()
|
||||
|
||||
producers.Wait()
|
||||
|
||||
@@ -80,7 +80,7 @@ func main() {
|
||||
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
pipe.FetcherDB(ctx, config.Fetcher, store, fetcherQueue, pipe.Send(grapherQueue))
|
||||
pipe.FetcherDB(ctx, config.Fetcher, fetcherQueue, store, pipe.Send(grapherQueue))
|
||||
close(grapherQueue) // FetcherDB is the only event producer
|
||||
}()
|
||||
|
||||
@@ -92,7 +92,7 @@ func main() {
|
||||
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
pipe.Grapher(ctx, config.Engine.Grapher, db, grapherQueue)
|
||||
pipe.Grapher(ctx, config.Engine.Grapher, grapherQueue, db)
|
||||
}()
|
||||
|
||||
wg.Wait()
|
||||
|
||||
Reference in New Issue
Block a user