Skip to content

Multiple updates, esp: Use "run as" property to manage workers

totten requested to merge master-oct into master

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 PipeConnections in a way that respects runAs requirements.

  • Each PipeConnection will only be given tasks for a single identity (e.g. [domainId=>1, contactId=>100] or d1-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 PipeConnections for different tasks (subject to the Configuration 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 the Configuration limits on #workers/#tasks/duration/etc).

Merge request reports

Loading