The problem studied in this paper is a wavelength allocation algorithm applied to a metropolitan optical packet-switched ring network. Existing algorithms that provide optimal wavelength allocation generally require excessive computational time even with a small network of 8 to 16 nodes. Therefore, those approaches seem to be inappropriate for providing a dynamic real time wavelength allocation, which reacts as rapidly as possible to the growth of data traffic. In this work we present an approach for real time resource allocation (the so-called R2A) algorithm applied to optical packet-switched ring networks. This is based on equivalent bandwidth methods and heuristic iterative algorithm that can be executed in real-time. We also use simulations to evaluate the performance of the network configured according to the wavelength allocation map provided by R2A.