Closed leafnunes closed 6 years ago
I'm not sure a default timeout of 2 seconds is the best option. How about adding a Timeout property to the Client
type that is empty by default, meaning no timeout. Query
will still use the default client which won't time out, but if you need to make your own client to do custom timeout things you can.
Thanks for the quick feedback! That seems reasonable, though i wonder at the number of users who will have to customize Clients to deal with something pretty common. I'm seeing the hanging behavior while using https://github.com/shirou/gopsutil (at https://github.com/shirou/gopsutil/blob/master/cpu/cpu_windows.go#L117). I'll give your suggestion a shot and update gopsutil as well. Thanks again!
On further reflection, it's just as easy for the clients to set timeouts themselves as it is to set up custom clients for queries.
This is an attempt to address: https://github.com/StackExchange/wmi/issues/34