Best practice to use inline functions for the invokes or separate function ? #1263
arshia-rgh
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For the invokes, is it better to use inline functions or separated???
`func main() {
app := fx.New(
RabbitModule,
fx.Invoke(
PreDownloadProcess,
),
)
app.Run()
}
func PreDownloadProcess(lc fx.Lifecycle, ch *amqp.Channel, conn *amqp.Connection) {
lc.Append(fx.Hook{
OnStart: func(ctx context.Context) error {
return nil
},
OnStop: func(ctx context.Context) error {
return nil
},
})
}`
or use the inline function in the invoke directly ?
Beta Was this translation helpful? Give feedback.
All reactions