Cook the bacon in a large skillet over medium heat, turning occasionally until browned and crisp. Drain pan and dry bacon on paper towels; keep the skillet on the heat. Add the oil and onion and cook, stirring occasionally, until softened and translucent, about 3 minutes. Remove from heat.
Whisk together the milk and egg in a large serving bowl until well-combined. Stir in the onion.
Bring a large saucepan of salted water to a boil. Add spaghetti, and cook according to package directions. Two minutes before the spaghetti is done, stir in the peas. Drain and immediately transfer to the milk mixture. Toss until the pasta is well coated. Add the cheese, parsley, salt and pepper and toss well. Crumble the bacon into small pieces over the spaghetti and toss. Serve immediately.