Example #1
0
func handleTask(request *cocaine.Request, response *cocaine.Response) {
	defer response.Close()
	raw := <-request.Read()
	var task tasks.ParsingTask
	err := common.Unpack(raw, &task)
	if err != nil {
		response.ErrorMsg(-100, err.Error())
		return
	}
	err = parsing.Parsing(ctxParsing, task)
	if err != nil {
		response.ErrorMsg(-100, err.Error())
	} else {
		response.Write("OK")
	}
}
Example #2
0
func main() {
	t := parsing.Task{"imagick01g.photo.yandex.ru", "photo_proxy.json", "testgroup", 100, 400, "UNIQUEID"}
	log.Println(parsing.Parsing(t))
}