from httpclient import nil
import htmlparser,xmltree
import threadpool
import streams
proc test() {.gcsafe.} =
let url = "http://www.xxxx.com"
let response = httpclient.request(url,sslContext = nil)
var html = parseHtml(newStringStream(response.body))
echo "over!"
spawn test()
sync()
Error:'test' is not GC-safe as it calls 'parseHtml'.
I want to parse in a thread, and I don't want to use channel to send too many data. Thanks!
This looks to be an issue with forward declarations (whether intentional or unintentional, I do not know).
This works according to the spec, for better or worse.