grid icon indicating copy to clipboard operation
grid copied to clipboard

Optionally pass in Context to Server New

Open araddon opened this issue 7 years ago • 1 comments

It might be helpful to be able to pass in a context to grid server so an an outside agent can cancel it? And or the context used in Server is a child of parent context?

https://github.com/lytics/grid/blob/master/server.go#L47

araddon avatar Jun 08 '17 17:06 araddon

That seems ok to me. So the change would be to use the provided when creating this [context]:(https://github.com/lytics/grid/blob/master/server.go#L109) instead of a context.Background.

I'd suggest passing in the "providedcontext via theCfg` struct to make it optional? The Cfg is available on the server struct when this packages ctx is created and has helpers to ensure defaults values.

epsniff avatar Jun 08 '17 17:06 epsniff