4.4.15 • Published 2 years ago

@celastrina/timer v4.4.15

Weekly downloads
614
License
MIT
Repository
github
Last release
2 years ago

@celastrina/timer

Celastrina Add-On for Time Triggers in Azure Functions.

Quick Start

Creating your first Timer Function:

const {LOG_LEVEL, CelastrinaError, Configuration} = require(“@celastrina/core”);
const {TickEvent, TimerFunction, TimerAddOn} = require(“@celastrina/timer”);

class MyFirstFunction extends TimerFunction {
    constructor(config) {
        super(config);
    } 

    async onTick(event) {
        // Successful tick event!
		event.context.log("Welcome!", LOG_LEVEL.INFO);
		// To reject the event
		//event.reject(CelastrinaError.newError("Something Happened!"));
		// To abort the event, set TimerAddOn.abortOnReject=true, or invoke event.abort();
	}
	
	async onReject(event) {
	    // Rejected tick event.
	    // Rejections do not throw exceptions unless TimerAddOn.abortOnReject=true.
	}
	
	async onAbort(event) {
	    // Aborted event. Typically when an exception happens or TimerAddOn.abortOnReject=true.
	    // TimerFunction will throw the exception after this method is called.
	}
}
 
const _config = new Configuration(“MyFirstFunction”);
const _timerconfig = new TimerAddOn();
_config.addOn(_timerconfig);
module.exports = new MyFirstFunction (_config);

You will need to make a few updates to your function.json. You’ll need to add an “entryPoint” attribute with the value “execute” and ensure your binding is named “tick”.

{
    “entryPoint”: “execute”,
    "bindings": [
        {
           "name": "tick",
           "type": "timerTrigger",
           "direction": "in",
           "schedule": "0 */5 * * * *"
        }
    ]
}

For more information please visit @celastrina/timer wiki on Github.

4.4.15

2 years ago

4.3.13

3 years ago

4.3.12

3 years ago

4.4.14

3 years ago

4.4.13

3 years ago

4.2.12

3 years ago

4.1.7

4 years ago

4.2.7

4 years ago

4.2.8

4 years ago

4.1.4

4 years ago

4.2.10

3 years ago

4.1.3

4 years ago

4.2.11

3 years ago

4.1.6

4 years ago

4.1.5

4 years ago

4.1.0

4 years ago

4.1.2

4 years ago

4.1.1

4 years ago

4.0.0

4 years ago

2.0.5

4 years ago

2.0.51

4 years ago

2.0.52

4 years ago

2.0.3

4 years ago

2.0.4

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.8.58

4 years ago

1.8.56

4 years ago

1.8.57

4 years ago

1.8.55

4 years ago

1.8.51

4 years ago

1.8.0

4 years ago

1.7.6

4 years ago

1.7.5

4 years ago

1.7.0

4 years ago

1.6.15

4 years ago

1.6.17

4 years ago

1.6.16

4 years ago

1.6.18

4 years ago

1.6.13

4 years ago

1.6.14

4 years ago

1.6.12

4 years ago

1.6.11

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.8

4 years ago

1.5.7

4 years ago

1.5.6

4 years ago

1.5.5

4 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.994

4 years ago

1.4.993

4 years ago

1.4.995

4 years ago

1.4.992

4 years ago

1.4.991

4 years ago