Project

sp-job

0.0
No release in over 3 years
Low commit activity in last 3 years
Base classes for your own jobs and open sourced generic utility jobs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
>= 0
~> 10.0
~> 3.0

Runtime

>= 0
>= 0
>= 0
>= 0
>= 0
>= 0
>= 0
>= 0
>= 0
>= 0
 Project Readme

Sp::Job

Execute the job

The job is executed method perform of the job class. If the tube is called 'park-fun'

  class ParkFun

  def self.perform (job)

  end

Return the job result

use send_response(result: object)

Report a non-fatal error

return report_error(message: 'i18n_message_key", args)

Report a fatal error

Use raise_error(message: 'i18n_message_key", args)

Database access

Use the db object.

db.exec

The first argument is the query string followed by a variable number of arguments that are bound to the query.

   db.exec('SELECT fun FROM public.park where id=$1', id_value)

Returns an xxx

db.query

Redis

Use the redis accessor to obtain a Redis object already connected

Sending mails

Call send_mail

Job configuration

Use config

Logging

Use logger