0.2.1 • Published 5 years ago

@channel/pubsub v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@channel/pubusb

This package is experimental!

A generic pubsub class, implemented with channels

For more information, visit channel.js.org.

interface PubSub<T> {
  publish(topic: string, value: T): Promise<void> | void;
  unpublish(topic: string, reason?: any): Promise<void> | void;
  subscribe(topic: string, buffer?: ChannelBuffer<T>): AsyncIterableIterator<T>;
  close(reason?: any): Promise<void> | void;
}

class InMemoryPubSub<T> implements PubSub<T> {
  publish(topic: string, value: T): void;
  unpublish(topic: string, reason?: any): void;
  subscribe(topic: string, buffer?: ChannelBuffer<T>): Channel<T>;
  close(reason?: any): void;
}
0.2.1

5 years ago

0.2.0

5 years ago

0.2.0-alpha.1

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.1.0-alpha.0

5 years ago