async function person()

in javascript/greeter/functions.js [38:57]


async function person(context, message) {
	// update the visit count
	let visits = context.storage.visits;
	visits += 1;
	context.storage.visits = visits

	// enrich the request with the number of vists.
  	let request = message.as(GreetRequestType)
	request.visits = visits

	// next, we will forward a message to a special greeter function,
	// that will compute a super-doper-personalized greeting based on the
	// number of visits that this person has.
	context.send(messageBuilder({
		typename: "example/greeter",
		id: request.name,
		value: request,
		valueType: GreetRequestType
	}));
}