mfarache / micronaut-ms

21 stars 7 forks source link

Reactive - is MapBillService multithreaded? #1

Closed ahus1 closed 6 years ago

ahus1 commented 6 years ago

I've read your tutorial and got this question. Maybe you can help me here.

I've worked with the Vert.x reactive framework. There all services where single threaded.

How does Micronaut work? You are backing MapBillService with a HashMap. If it is single threaded, this will corrupt the map or run into concurrency issues.

Thanks!

mfarachepiksel commented 6 years ago

Yes, HashMap was the quickest/naive implementation as my focus was micronaut itself. A ready to go production would use a ConcurrentMap which is the right solution to avoid thread-safety issues.