pub struct HttpPollSource;Expand description
HTTP polling source factory.
Implementations§
Source§impl HttpPollSource
impl HttpPollSource
Sourcepub fn new(
req: RequestSpec,
interval: Duration,
) -> Source<Result<HttpResponse, HttpError>>
pub fn new( req: RequestSpec, interval: Duration, ) -> Source<Result<HttpResponse, HttpError>>
Poll req with a plain GET every interval, emitting each
Result<HttpResponse, HttpError> in order.
The first poll happens after the first interval has elapsed. The
returned source is effectively infinite — terminate it downstream with
take, a atomr_streams::KillSwitch, etc.
Sourcepub fn with_etag(
req: RequestSpec,
interval: Duration,
) -> Source<Result<HttpResponse, HttpError>>
pub fn with_etag( req: RequestSpec, interval: Duration, ) -> Source<Result<HttpResponse, HttpError>>
Like new but performs a conditional GET: after the
first successful response carrying an ETag, subsequent requests send
If-None-Match: <etag>. A 304 Not Modified is surfaced as
HttpResponse with not_modified == true and an empty body.
Auto Trait Implementations§
impl Freeze for HttpPollSource
impl RefUnwindSafe for HttpPollSource
impl Send for HttpPollSource
impl Sync for HttpPollSource
impl Unpin for HttpPollSource
impl UnsafeUnpin for HttpPollSource
impl UnwindSafe for HttpPollSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more