Cook over medium heat, stirring constantly, until mixture thickens and comes to a boil (about 6 minutes). Reduce heat to simmer, stirring constantly for an additional minute. Remove from heat. Stir in butter and vanilla. Cover with plastic wrap. Refrigerate until cool (or overnight).
To ensure food safety, eggs should be cooked until both the yolk and the white are firm. Consuming raw or undercooked eggs may increase your risk of foodborne illness, especially for those with certain medical conditions. For recipes that call for eggs that are raw or undercooked when the dish is served, use either pasteurized shell eggs that have been treated to destroy Salmonella, or use pasteurized egg products.