[vt-password] How to make rules threadsafe

19 views
Skip to first unread message

Himanshu Bhardwaj

unread,
Dec 27, 2014, 6:57:22 AM12/27/14
to vt-middle...@googlegroups.com
Hi,

In order to make PasswordValidator threadsafe, its required that the underlying rules comprising validator are made thread-safe. I am planning to inject the validator as Singleton. How can I make the rules threadsafe inside the validator?

--
Thanks & Regards

dfisher

unread,
Jan 8, 2015, 9:31:26 AM1/8/15
to vt-middle...@googlegroups.com
As long as you protect access to the rule mutators, you shouldn't have any threading issues.
We use the PasswordValidator in a multi-threaded environment without any issues.
Of course, if you implement your own rules, you'll need to ensure that the #validate implementation doesn't change the state of your rule.

--Daniel Fisher
Reply all
Reply to author
Forward
0 new messages