Niels van Klaveren
unread,May 22, 2013, 10:59:58 AM5/22/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to clj-we...@googlegroups.com
Say
I have several scenario's of serial transactions (consisting of several
operations) on a browser through clj-webdriver, that I would want to
run in simultaneously on multiple browsers.
Each action should log
some results (timing), preferably to a shared data structure for all
browsers (either an agent or an atom).
If an action fails
(exception/timeout), the browser should be reverted to its original
state (by logging in to the original site again), and start the next
transaction.
What would be the best abstraction to do this ? I've tried / contemplated futures, browsers as agents, pmap or even reducers.
All seem to have their different pros and cons, and frankly, I'm only getting more confused.
Agents
seem to have a nice fit with reset functions and a task queue being
implemented, but as far as I can tell, there's no way to put each action
queue on one thread for one agent.
I read something about a new send-via option for agents in Clojure 1.5 which might be relevant, but documentation and examples are almost non-existant.
Future's supposedly
can't be chained, so if futures would be used they should contain a map over the whole
scenario for each browser.
Exception handling and resetting should be handled by my own
code within this map loop, as well as transaction support.
What would be the best abstraction to do this ?