--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/dbc71d47-d63b-4eb2-9320-5dcf8e55e25an%40googlegroups.com.
Session
instances are immutable!
Why is that so? Because Sessions are messages that are dealt with in a multi-threaded concurrent way, so immutability is the best way to deal with state without relying on synchronization and blocking.
A very common pitfall is to forget that set
and setAll
actually return new instances.
val session: Session = ???
// wrong usage
session.set("foo", "FOO") // wrong: the result of this set call is just discarded
session.set("bar", "BAR")
// proper usage
session.set("foo", "FOO").set("bar", "BAR")
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/b3ac14f7-135f-4ad3-8b70-fb93b00e7c49n%40googlegroups.com.