Files
kami-parse-server/src/Adapters/PubSub/PubSubAdapter.js
Florent Vilmart d83a0b6808 Use Prettier JS (#5017)
* Adds prettier

* Run lint before tests
2018-09-01 13:58:06 -04:00

50 lines
982 B
JavaScript

/*eslint no-unused-vars: "off"*/
/**
* @module Adapters
*/
/**
* @interface PubSubAdapter
*/
export class PubSubAdapter {
/**
* @returns {PubSubAdapter.Publisher}
*/
static createPublisher() {}
/**
* @returns {PubSubAdapter.Subscriber}
*/
static createSubscriber() {}
}
/**
* @interface Publisher
* @memberof PubSubAdapter
*/
interface Publisher {
/**
* @param {String} channel the channel in which to publish
* @param {String} message the message to publish
*/
publish(channel: string, message: string): void;
}
/**
* @interface Subscriber
* @memberof PubSubAdapter
*/
interface Subscriber {
/**
* called when a new subscription the channel is required
* @param {String} channel the channel to subscribe
*/
subscribe(channel: string): void;
/**
* called when the subscription from the channel should be stopped
* @param {String} channel
*/
unsubscribe(channel: string): void;
}
export default PubSubAdapter;