GRPC.Stream.Operators (gRPC v0.11.5)

View Source

Useful and internal functions for manipulating streams.

Summary

Types

item()

@type item() :: any()

reason()

@type reason() :: any()

Functions

ask(stream, target, timeout \\ 5000)

@spec ask(GRPC.Stream.t(), pid() | atom(), non_neg_integer()) ::
  GRPC.Stream.t() | {:error, :timeout | :process_not_alive}

ask!(stream, target, timeout \\ 5000)

@spec ask!(GRPC.Stream.t(), pid() | atom(), non_neg_integer()) :: GRPC.Stream.t()

effect(stream, effect_fun)

@spec effect(GRPC.Stream.t(), (term() -> term())) :: GRPC.Stream.t()

filter(stream, filter)

@spec filter(GRPC.Stream.t(), (term() -> term())) :: GRPC.Stream.t()

flat_map(stream, flat_mapper)

@spec flat_map(GRPC.Stream.t(), (term() -> Enumerable.GRPCStream.t())) ::
  GRPC.Stream.t()

map(stream, mapper)

@spec map(GRPC.Stream.t(), (term() -> term())) :: GRPC.Stream.t()

map_error(stream, func)

@spec map_error(GRPC.Stream.t(), (reason() -> term())) :: GRPC.Stream.t()

map_with_context(stream, mapper)

@spec map_with_context(GRPC.Stream.t(), (map(), term() -> term())) :: GRPC.Stream.t()

partition(stream, options \\ [])

@spec partition(
  GRPC.Stream.t(),
  keyword()
) :: GRPC.Stream.t()

reduce(stream, acc_fun, reducer_fun)

@spec reduce(GRPC.Stream.t(), (-> acc), (term(), acc -> acc)) :: GRPC.Stream.t()
when acc: term()

reject(stream, filter)

@spec reject(GRPC.Stream.t(), (term() -> term())) :: GRPC.Stream.t()

uniq(stream)

@spec uniq(GRPC.Stream.t()) :: GRPC.Stream.t()

uniq_by(stream, fun)

@spec uniq_by(GRPC.Stream.t(), (term() -> term())) :: GRPC.Stream.t()