ruby - Nokogiri vs Goliath...or, can they get along? -


i have project needs parse literally hundreds of thousands of html , xml documents.

i thought perfect opportunity learn ruby fibers , new goliath framework.

but obviously, goliath falls flat if use blocking libraries. problem is, don't know how tell "thread safe" (if that's correct term goliath).

so question is, nokogiri going cause issues goliath or multi-threading/fibers in general?

if so, there safer use nokogiri?

thanks

goliath web framework, i'm assuming you're planning "ingest" these documents via http? each request gets mapped ruby fiber, effectively, server runs in single reactor thread.

so, answer question: nokogiri thread safe best of knowledge, shouldn't matter here. thing have out for: while document being parsed, cpu pinned, , goliath wont accept new requests in meantime. so, you'll have implement correct logic handle specific case (ex: stream parse on chunks of data arriving socket, or load balance between multiple goliath servers, or both ... :-))


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -