Documentation ¶
Index ¶
- Constants
- func CheckForPGNotifierEnvVars() bool
- func GetCurrentSQLTimestamp() string
- func GetPGNotifierConnectionString() string
- func Init()
- type Claim
- type ClaimResponse
- type JobPayload
- type JobsResponse
- type MessagePayload
- type PGNotifier
- func (notifier *PGNotifier) ClearJobs(ctx context.Context) (err error)
- func (notifier *PGNotifier) GetDBHandle() *sql.DB
- func (notifier *PGNotifier) Publish(ctx context.Context, payload MessagePayload, schema *whUtils.Schema, ...) (ch chan []Response, err error)
- func (notifier *PGNotifier) RunMaintenanceWorker(ctx context.Context) error
- func (notifier *PGNotifier) Subscribe(ctx context.Context, workerId string, jobsBufferSize int) chan Claim
- func (notifier *PGNotifier) UpdateClaimedEvent(claim *Claim, response *ClaimResponse)
- type Response
Constants ¶
View Source
const ( WaitingState = "waiting" ExecutingState = "executing" SucceededState = "succeeded" FailedState = "failed" AbortedState = "aborted" )
View Source
const (
AsyncJobType = "async_job"
)
Variables ¶
This section is empty.
Functions ¶
func CheckForPGNotifierEnvVars ¶ added in v0.1.10
func CheckForPGNotifierEnvVars() bool
CheckForPGNotifierEnvVars Checks if all the required Env Variables for PG Notifier are present
func GetCurrentSQLTimestamp ¶
func GetCurrentSQLTimestamp() string
GetCurrentSQLTimestamp to get sql complaint current datetime string
func GetPGNotifierConnectionString ¶ added in v0.1.10
func GetPGNotifierConnectionString() string
GetPGNotifierConnectionString Returns PG Notifier DB Connection Configuration
Types ¶
type ClaimResponse ¶ added in v1.7.0
type ClaimResponse struct { Payload json.RawMessage Err error }
type JobPayload ¶ added in v0.1.10
type JobPayload json.RawMessage
type JobsResponse ¶ added in v1.2.0
type MessagePayload ¶ added in v1.2.0
type MessagePayload struct { Jobs []JobPayload JobType string }
type PGNotifier ¶ added in v1.7.0
type PGNotifier struct { URI string // contains filtered or unexported fields }
func New ¶
func New(workspaceIdentifier, fallbackConnectionInfo string) (notifier PGNotifier, err error)
New Given default connection info return pg notifier object from it
func (*PGNotifier) ClearJobs ¶ added in v1.7.0
func (notifier *PGNotifier) ClearJobs(ctx context.Context) (err error)
func (*PGNotifier) GetDBHandle ¶ added in v1.7.0
func (notifier *PGNotifier) GetDBHandle() *sql.DB
func (*PGNotifier) Publish ¶ added in v1.7.0
func (notifier *PGNotifier) Publish(ctx context.Context, payload MessagePayload, schema *whUtils.Schema, priority int) (ch chan []Response, err error)
func (*PGNotifier) RunMaintenanceWorker ¶ added in v1.7.0
func (notifier *PGNotifier) RunMaintenanceWorker(ctx context.Context) error
RunMaintenanceWorker (blocking - to be called from go routine) re-triggers zombie jobs which were left behind by dead workers in executing state
func (*PGNotifier) UpdateClaimedEvent ¶ added in v1.7.0
func (notifier *PGNotifier) UpdateClaimedEvent(claim *Claim, response *ClaimResponse)
Click to show internal directories.
Click to hide internal directories.