Notifications (RFC-072)
A period when the community can review the RFC (comment Docs)
Document Maintainers: Andi Gabriel Tan 2024. List of other contributors in Annex. 1.
Copyright: MIT license
Copyright © 2018-2024 Axiologic Research and Contributors.
This document is licensed under MIT license.
Abstract
The purpose of the “notifications” API space is to offer a set of portable functions for sending and receiving KeySSI-based notifications
1. Notifications functions
//Load openDSU environment
require("../privatesky/psknode/bundles/openDSU");
//Load openDSU SDK
const opendsu = require("opendsu");
//Load keyssi library
const keyssispace = opendsu.loadApi("keyssi");
//Load keyssi library
const notifications = opendsu.loadApi("notifications");
//Build a newKeySSI
const seedSSI = keyssispace.createSeedSSI("default");
notifications.publish(seedSSI,"hello", (err, status) =>{
console.log(status);
});
How to use
Function getObservableHandler(keySSI, timeout)
Description: Get notifications observable object for the selected keySSI.
Name | Type | Value | Description |
---|---|---|---|
keySSI | KeySSI object | The keySSI from which you want to get the handler. | |
timeout | number | The amount of time before the request times out. |
Returns
Name | Description |
---|---|
Observable | object |
Function publish(keySSI, message, timeout, callback)
Description: Push notification to the selected keySSI via its associated notifications endpoint.
Name | Type | Value | Description |
---|---|---|---|
keySSI | KeySSI object | The keySSI from which you want to notify. | |
message | string | *required | The message you want to publish. |
timeout | number (ms) | The amount of time before the request times out. | |
callback | function | *required |
Callback parameters
Name | Type | Response example |
---|---|---|
err | ErrorWrapper object | Contains a message and the error. |
response |
Description: Contains a message and the error./Contains the response.
Function unsubscribe(observable)
Description: Unsubscribe from notifications.
Name | Type | Value | Description |
---|---|---|---|
observable | Observable object | The observable object. |
Returns: This function does not return anything.
Function isSubscribed(observable)
Description: Check if there exists a subscription.
Name | Type | Value | Description |
---|---|---|---|
observable | Observable object | The observable object. |
Returns: A boolean value.
Contributors
-
Axiologic Research: New content and improvements. Original texts under PharmaLedger Association and Novartis funding. MIT licensed content accordingly with the contracts. Publish and maintain the www.opendsu.org site.
-
PharmaLedger Project: Review, feedback, observations, new content, and corrections MIT licensed accordingly with the consortium agreements.
- PrivateSky Research Project: MIT licensed content accordingly with the contracts. https://profs.info.uaic.ro/~ads/PrivateSky/
Annex 1. Contributors
Current Editors | |
---|---|
Sînică Alboaie | sinica.alboaie@axiologic.net |
Cosmin Ursache | cosmin@axiologic.net |
Teodor Lupu | teodor@axiologic.net |
Andi-Gabriel Țan | andi@axiologic.net |
Contributors Axiologic Research | |
Adrian Ganga | adrian@axiologic.net |
Andi-Gabriel Țan | andi@axiologic.net |
Cosmin Ursache | cosmin@axiologic.net |
Daniel Sava | daniel@axiologic.net |
Nicoleta Mihalache | nicoleta@axiologic.net |
Valentin Gérard | valentin@axiologic.net |
PrivateSky Contributors | |
Alex Sofronie | alsofronie@gmail.com (DPO) |
Cosmin Ursache | cos.ursache@gmail.com (UAIC) |
Daniel Sava | sava.dumitru.daniel@gmail.com (HVS, AQS) |
Daniel Visoiu | visoiu.daniel.g@gmail.com (SGiant) |
Lenuța Alboaie | lalboaie@gmail.com (UAIC) |
Rafael Mastaleru | rafael@rms.ro (RMS) |
Sînică Alboaie | salboaie@gmail.com (UAIC) |
Vlad Balmos | vlad.balmos@gmail.com (Code932) |
PharmaLedger Contributors | |
Ana Balan | bam@rms.ro (RMS) |
Bogdan Mastahac | mab@rms.ro (RMS) |
Cosmin Ursache | cos@rms.ro (RMS) |
Rafael Mastaleru | raf@rms.ro (RMS) |