Multiple updates, esp: Use "run as" property to manage workers
This is a collection with many little cleanups+fixes. However, there's one major update -- it adds support for setting the active user while processing a task.
== Before
Identities are not used. All tasks are assigned to the same context, even if they have different identities.
Tasks that require a specific identity requirement (runAs=>[domainId=>1,contactId=>100]
) are likely to fail.
== After
Tasks are dispatched to PipeConnection
s in a way that respects runAs
requirements.
- Each
PipeConnection
will only be given tasks for a single identity (e.g.[domainId=>1, contactId=>100]
ord1-c100
). - When setting up a
PipeConnection
, it will login with the appropriate identity. - If you have a dozen consecutive tasks for the same identity, then it is permitted to re-use
PipeConnection
s for different tasks (subject to theConfiguration
limits on #workers/#tasks/duration/etc). - If you have a dozen consecutive tasks with many different identities, then old/idle
PipeConnections
will close - and new ones will start (subject to theConfiguration
limits on #workers/#tasks/duration/etc).