<@U6P03BM0W> I wonder if there’s anything to gain,...
# klaxon
c
@dave08 I wonder if there’s anything to gain, where do you see parallelizable units of work? Network access is not really part of Klaxon
p
Hi All, I'm having several issues with controllers that end in a forward, like this:
Copy code
def savePerson() {
		...
		PersonEnt person = personService.savePerson(personJSON)

		forward( action: "findPerson", params:[ personId: person.id ] )
	}
As part of 'personService.savePerson' logic, a 'StatusEnt' is saved. This 'StatusEnt' has an 'owner id', which references the id of the person once it's available (no foreign key) The problem is: in the 'findPerson' logic, after the forward has taken place, the StatusEnt is sometimes not there yet (maybe 1 in 4 times). It always gets saved to the DB, every time, but not quick enough. In short: How do I guarantee that every entity before the forward is fully flushed to the db before the 'findPatient' logic begins? (Grails 3.3.8) Thanks
d
What's parallelizable is multiple json transforms working at the same time (multiple requests to a REST service with json payload for request and response). These requests/repsonses work with async byte streams and suspend on network latency, which would free up threads when data is being waited for so that other processing can be done. It would be even more interesting in larger JsonArray responses if Klaxon would return a Channel of objects already parsed. Maybe it would have to work with some kind of buffer, so that the context switch doesn't happen for every few bytes. I'm not sure how much this would all gain, I was wondering if tesing this somehow is feasable with Klaxon's current structure?