rsocket-adapter-rxjs
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3
@@ -6,5 +6,5 @@ /// <reference types="node" /> | ||
import { Observable, SchedulerLike } from "rxjs"; | ||
export declare function fireAndForget<TData>(data: TData, inputCodec: Codec<TData>): (rsocket: RSocket, metadata: Map<string | number | WellKnownMimeType, Buffer>) => Observable<void>; | ||
export declare function requestResponse<TData, RData>(data: TData, inputCodec: Codec<TData>, outputCodec: Codec<RData>): (rsocket: RSocket, metadata: Map<string | number | WellKnownMimeType, Buffer>) => Observable<RData>; | ||
export declare function requestStream<TData, RData>(data: TData, inputCodec: Codec<TData>, outputCodec: Codec<RData>, prefetch?: number, scheduler?: SchedulerLike): (rsocket: RSocket, metadata: Map<string | number | WellKnownMimeType, Buffer>) => Observable<RData>; | ||
export declare function requestChannel<TData, RData>(datas: Observable<TData>, inputCodec: Codec<TData>, outputCodec: Codec<RData>, prefetch?: number, scheduler?: SchedulerLike): (rsocket: RSocket, metadata: Map<string | number | WellKnownMimeType, Buffer>) => Observable<RData>; | ||
export declare function fireAndForget<TData>(data: TData, inputCodec: Codec<TData>): (rsocket: RSocket, metadata?: Map<string | number | WellKnownMimeType, Buffer>) => Observable<void>; | ||
export declare function requestResponse<TData, RData>(data: TData, inputCodec: Codec<TData>, outputCodec: Codec<RData>): (rsocket: RSocket, metadata?: Map<string | number | WellKnownMimeType, Buffer>) => Observable<RData>; | ||
export declare function requestStream<TData, RData>(data: TData, inputCodec: Codec<TData>, outputCodec: Codec<RData>, prefetch?: number, scheduler?: SchedulerLike): (rsocket: RSocket, metadata?: Map<string | number | WellKnownMimeType, Buffer>) => Observable<RData>; | ||
export declare function requestChannel<TData, RData>(datas: Observable<TData>, inputCodec: Codec<TData>, outputCodec: Codec<RData>, prefetch?: number, scheduler?: SchedulerLike): (rsocket: RSocket, metadata?: Map<string | number | WellKnownMimeType, Buffer>) => Observable<RData>; |
@@ -45,6 +45,7 @@ /* | ||
return function (rsocket, metadata) { | ||
var encodedMetadata = metadata ? (0, rsocket_composite_metadata_1.encodeCompositeMetadata)(metadata) : null; | ||
return new RSocketPublisherToObservable_1.default(function (s) { | ||
return rsocket.fireAndForget({ | ||
data: data ? inputCodec.encode(data) : Buffer.allocUnsafe(0), | ||
metadata: (0, rsocket_composite_metadata_1.encodeCompositeMetadata)(metadata), | ||
metadata: encodedMetadata, | ||
}, s); | ||
@@ -57,6 +58,7 @@ }); | ||
return function (rsocket, metadata) { | ||
var encodedMetadata = metadata ? (0, rsocket_composite_metadata_1.encodeCompositeMetadata)(metadata) : null; | ||
return new RSocketPublisherToObservable_1.default(function (s) { | ||
return rsocket.requestResponse({ | ||
data: data ? inputCodec.encode(data) : Buffer.allocUnsafe(0), | ||
metadata: (0, rsocket_composite_metadata_1.encodeCompositeMetadata)(metadata), | ||
metadata: encodedMetadata, | ||
}, s); | ||
@@ -71,6 +73,7 @@ }, outputCodec); | ||
return function (rsocket, metadata) { | ||
var encodedMetadata = metadata ? (0, rsocket_composite_metadata_1.encodeCompositeMetadata)(metadata) : null; | ||
return new RSocketPublisherToPrefetchingObservable_1.default(function (s, n) { | ||
return rsocket.requestStream({ | ||
data: data ? inputCodec.encode(data) : Buffer.allocUnsafe(0), | ||
metadata: (0, rsocket_composite_metadata_1.encodeCompositeMetadata)(metadata), | ||
metadata: encodedMetadata, | ||
}, n, s); | ||
@@ -87,4 +90,5 @@ }, prefetch, outputCodec, scheduler); | ||
resetOnRefCountZero: true, | ||
})), function (_value, index) { return index === 0; }), 2), firstValueObservable = _a[0], restValuestObservable = _a[1]; | ||
})), function (_value, index) { return index === 0; }), 2), firstValueObservable = _a[0], restValuesObservable = _a[1]; | ||
return function (rsocket, metadata) { | ||
var encodedMetadata = metadata ? (0, rsocket_composite_metadata_1.encodeCompositeMetadata)(metadata) : null; | ||
return firstValueObservable.pipe((0, rxjs_1.take)(1), (0, rxjs_1.concatMap)(function (firstValue) { | ||
@@ -94,5 +98,5 @@ return new Observer2BufferingSubscriberToPublisher2PrefetchingObservable_1.default(function (s) { | ||
data: inputCodec.encode(firstValue), | ||
metadata: (0, rsocket_composite_metadata_1.encodeCompositeMetadata)(metadata), | ||
metadata: encodedMetadata, | ||
}, prefetch, false, s); | ||
}, prefetch, restValuestObservable, inputCodec, outputCodec, scheduler); | ||
}, prefetch, restValuesObservable, inputCodec, outputCodec, scheduler); | ||
})); | ||
@@ -99,0 +103,0 @@ }; |
{ | ||
"name": "rsocket-adapter-rxjs", | ||
"version": "1.0.0-alpha.2", | ||
"version": "1.0.0-alpha.3", | ||
"license": "Apache-2.0", | ||
@@ -22,4 +22,4 @@ "main": "dist/index", | ||
"dependencies": { | ||
"rsocket-core": "^1.0.0-alpha.1", | ||
"rsocket-messaging": "^1.0.0-alpha.2", | ||
"rsocket-core": "^1.0.0-alpha.3", | ||
"rsocket-messaging": "^1.0.0-alpha.3", | ||
"rxjs": "^7.4.0" | ||
@@ -31,3 +31,3 @@ }, | ||
}, | ||
"gitHead": "c5113bbd2ab35ed5aa74d4e7d101aca5e5528ead" | ||
"gitHead": "7dc895fd0eb6c6c3f7ab9a945525f64a8df80bd1" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68826
828