Add oil to a pot over low to medium heat.
Add onions, garlic, and ginger and cook until translucent.
Add thyme, black pepper, and allspice and cook for a few minutes until fragrant.
Add pigeon peas, coconut milk, water, and salt and bring to a boil.
Cook on low heat while covered for about 30 minutes.
Add washed rice and stir. At this point you can taste for any further seasonings.
Cover with a lid, bring to a boil, and simmer for 25 minutes.
Allow rice to sit off the stove for another 15 minutes.
Once cooled, use a fork to fluff up the rice and serve.