Voedger Internals
  • Introduction
  • πŸ’‘Concepts
    • Event Sourcing & CQRS
    • Editions (deprecated)
      • Community Edition
      • Standart Edition
      • Standart Edition (v1)
  • πŸš€Server
    • Overview (Server)
    • Design
      • Query Processor
      • API Gateway implementation
      • N1 Cluster
      • N3 Cluster
      • N5 Cluster
      • Orchestration
      • Sequences
      • Packages overview
        • sys
        • registry
    • Features
      • API Gateway
        • API v2
          • Conventions
            • API URL
            • HTTP methods and processors
            • Naming conventions
            • Query constraints
            • Error handling
          • Documents and records
            • Create document or record
            • Update document or record
            • Deactivate document or record
            • Read document or record
            • Read from CDoc collection
          • Queries
            • Read from query
          • Views
            • Read from view
          • Commands
            • Execute command
          • BLOBs
            • Create BLOB
            • Read BLOB
          • Temporary BLOBs
            • Create temporary BLOB
            • Read temporary BLOB
          • Schemas
            • List app workspaces
            • List workspace roles
            • Read workspace role schema
        • API v1
          • API Conventions
          • BLOBs
      • Admin Endpoint
      • Clusters
        • Bootstrap
        • Monitoring
        • Secure prometheus and grafana
        • Alerting
        • Maintenance
          • SELECT, UPDATE
      • VVMs
      • Applications
        • Deploy Application
        • Sidecar Applications
      • AuthNZ
        • Issue Principal Token
        • Refresh Principal Token
        • Enrich Principal Token
        • ACL Rules
        • Global Roles
      • Data types
        • Core types
        • Small integers
        • Uniques With Multiple Fields
        • Verifiable Fields
      • Workspaces
        • Create Workspace
        • Deactivate Workspace
        • See also (Workspaces)
      • Invites
        • Invite to Workspace
        • Join Workspace
        • Leave Workspace
        • Cancel sent Invite
        • Cancel accepted Invite
        • Update Invite roles
      • Users
        • Create a new user
        • Change user password
        • Send Email
        • Reset password
        • Change Email
      • Notifications
        • Heartbeats
      • Devices
        • Create a new device
        • Join device to workspace
      • Jobs
      • DMBS Drivers
        • AmazonDB Driver
      • Frozen
        • Ephemeral Storage
        • Storage Extensions
  • πŸ› οΈFramework
    • Overview (Framework)
    • Features
      • vpm
      • vpm init
      • vpm tidy
      • vpm baseline
      • vpm orm
      • vpm build
      • API for testing
  • Development
    • Requirements Management
    • Requirements Management (Overview)
Powered by GitBook
On this page
  • Motivation
  • Principles
  • Functional design
  • Tech design
  • Context

Was this helpful?

Edit on GitHub
  1. πŸš€Server
  2. Features

Jobs

PreviousJoin device to workspaceNextDMBS Drivers

Last updated 6 months ago

Was this helpful?

Motivation

  • Import data periodically (SCADA, Supervisory Control and Data Acquisition)

  • Export data periodically (e.g. to pass French certification for Air)

Principles

  • Job is triggered by time events.

  • Jobs are controlled by Schedulers.

  • Jobs are executed per ApplicationWorkspaces.

  • Time events are not kept in logs (PLog, WLog).

  • Job support the following intents:

    • Views

    • SendMail

  • Job state scope is almost the same as the Projector scope.

    • +JobContext

    • -Event

Functional design

VSQL:

ALTER WORKSPACE sys.AppWorkspaceWS (
    VIEW JobStateView(
        Fixed int,
        Data bytes,
        PRIMARY KEY ((Fixed))
    ) AS RESULT OF TestJob1;

	EXTENSION ENGINE BUILTIN (
		-- `CRON` token is not needed
		JOB Job1 '1 0 * * *' INTENTS(View(JobStateView));
	);
);
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ minute (0 - 59)
 β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ hour (0 - 23)
 β”‚ β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ day of the month (1 - 31)
 β”‚ β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ month (1 - 12)
 β”‚ β”‚  β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ day of the week (0 - 6) (Sunday to Saturday, 0 is Sunday)
 β”‚ β”‚  β”‚  β”‚  β”‚
 1 0  *  *  *
  • Only sys.AppWorkspaceWS is allowed for now

Tech design

  • appparts

func New2(
	vvmCtx context.Context,
	structs istructs.IAppStructsProvider,
	syncAct SyncActualizerFactory,
	asyncActualizersRunner IProcessorRunner,
	jobSchedulerRunner IProcessorRunner, // <--------------- 
	eef iextengine.ExtensionEngineFactories,
) (ap IAppPartitions, cleanup func(), err error) {
	return newAppPartitions(vvmCtx, structs, syncAct, asyncActualizersRunner, jobSchedulerRunner, eef)
}

Context

  • https://www.ibm.com/docs/en/db2oc?topic=task-unix-cron-format

  • https://github.com/robfig/cron/blob/master/parser.go

pkg/processors/schedulers/ProvideSchedulers(), similar to

github: Jobs
ProvideActualizers