(P) worker

(M) CeleryDbConn

peek_plugin_base.worker.CeleryDbConn.getDbEngine()[source]
peek_plugin_base.worker.CeleryDbConn.getDbSession()[source]
peek_plugin_base.worker.CeleryDbConn.prefetchDeclarativeIds(Declarative, count) → typing.Union[typing.Iterable[int], NoneType][source]

Prefetch Declarative IDs

This function prefetches a chunk of IDs from a database sequence. Doing this allows us to preallocate the IDs before an insert, which significantly speeds up :

  • Orm inserts, especially those using inheritance
  • When we need the ID to assign it to a related object that we’re also inserting.
Parameters:
  • Declarative – The SQLAlchemy declarative class. (The class that inherits from DeclarativeBase)
  • count – The number of IDs to prefetch
Returns:

An iterable that dispenses the new IDs

peek_plugin_base.worker.CeleryDbConn.setConnStringForWindows()[source]

Set Conn String for Windiws

Windows has a different way of forking processes, which causes the @worker_process_init.connect signal not to work in “CeleryDbConnInit”

(M) CeleryDbConnInit

peek_plugin_base.worker.CeleryDbConnInit.initWorkerConnString(sender, **kwargs)[source]
peek_plugin_base.worker.CeleryDbConnInit.initWorkerProcessDbConn(**kwargs)[source]
peek_plugin_base.worker.CeleryDbConnInit.shutdownWorkerProcessDbConn(**kwargs)[source]
peek_plugin_base.worker.CeleryDbConnInit.taskEndCloseSession(**kwargs)[source]

(M) PeekWorkerPlatformHookABC

class peek_plugin_base.worker.PeekWorkerPlatformHookABC.PeekWorkerPlatformHookABC[source]

Bases: peek_plugin_base.PeekPlatformCommonHookABC.PeekPlatformCommonHookABC

(M) PluginWorkerEntryHookABC

class peek_plugin_base.worker.PluginWorkerEntryHookABC.PluginWorkerEntryHookABC(pluginName: str, pluginRootDir: str, platform: peek_plugin_base.worker.PeekWorkerPlatformHookABC.PeekWorkerPlatformHookABC)[source]

Bases: peek_plugin_base.PluginCommonEntryHookABC.PluginCommonEntryHookABC

celeryApp

Celery App

Return the workers instance of the celery app.

This will be configured with the platforms celery setup.

celeryAppIncludes

Celery App Includes

This property returns the absolout package paths to the modules with the tasks :Example: [“plugin_noop.worker.NoopWorkerTask”]

Returns:A list of package+module names that Celery should import.
platform