OpenHPS/openhps-rest

View on GitHub
src/client/nodes/sink/RESTClientSink.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { DataFrame, SinkNode } from '@openhps/core';
import { RESTClientNode } from '../RESTClientNode';
import { ClientOptions } from '../ClientOptions';

/**
 * @category Client
 */
export class RESTClientSink<In extends DataFrame> extends SinkNode<In> {
    private _remoteNode: RESTClientNode<In, In>;

    constructor(options: ClientOptions) {
        super(options);
        this._remoteNode = new RESTClientNode<In, In>(options);
    }

    public onPush(data: In): Promise<void> {
        return this._remoteNode.push(data);
    }
}