Preheat the oven to 200°C / 400°F / Gas mark 6.
Grease a 22 x 22cm ovenproof ceramic dish.
In a large saucepan, bring the milk to a gentle simmer, adding in the peppercorns the bay leaf and the onions and cook gently for about five minutes. Add in the fish and cook, simmering and covered for a further five minutes.
Remove from heat and drain, saving 2 cups of the milk.
To make the sauce, melt butter in a small pan and once bubbling, stir through the flour until texture is the texture of sand. Remove from heat and add a small amount of the reserved milk, whisking until smooth. Return to the heat and gradually add the remaining milk, whisking constantly until you have a smooth, white sauce. Stir through the cheese and season to taste.
Place fish and peas in the baking dish, pour over the sauce and gently mix through. Cut the pastry into one large circle and fit across the pie. Pinch the edges with a fork then brush the pastry with the egg.
Bake for 35 minutes and serve warm.