trait Producer[T] extends AnyRef
Producer that can be used to publish an event of type T to SQS queue An instance of producer should be instantiated before publishing.
// when publishing strings with the provided `client` to the given `queueUrl`
producer = Producer.make(client, queueUrl, Serializer.serializeString)- T
type of the event to publish
- Alphabetic
- By Inheritance
- Producer
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
produce(e: ProducerEvent[T]): Task[ProducerEvent[T]]
Publishes a single event and fails the task.
Publishes a single event and fails the task.
- e
event to produce.
- returns
result of the operation. Task fails if the server returns an error.
-
abstract
def
produceBatch(es: Iterable[ProducerEvent[T]]): Task[Iterable[ProducerEvent[T]]]
Publishes a batch of events.
Publishes a batch of events.
- es
events to publish.
- returns
result of publishing. The returned collection contains the same items that were published. Task fails if the server returns an error for any of the provided events.
-
abstract
def
produceBatchE(es: Iterable[ProducerEvent[T]]): Task[Iterable[ErrorOrEvent[T]]]
Publishes a batch of events.
Publishes a batch of events.
- es
events to publish.
- returns
result of publishing. The returned collection contains zio.sqs.producer.ErrorOrEvent Doesn't fail the Task if the server returns an error for any of the provided events. Instead, the resulting collection contains either the error for the given event or the published event itself. Task completes when all input events were processed (published to the server or failed with an error).
-
abstract
def
sendSink: ZSink[Any, Throwable, Iterable[ProducerEvent[T]], Nothing, Unit]
Sink that can be used to publish events.
Sink that can be used to publish events. Fails if the server returns an error for any of the published events.
- returns
sink for publishing.
-
abstract
def
sendStream: (Stream[Throwable, ProducerEvent[T]]) ⇒ ZStream[Any, Throwable, ProducerEvent[T]]
Stream that takes events to publish and produces a stream with published events.
Stream that takes events to publish and produces a stream with published events. Fails if the server returns an error for any of the published events.
// ZIO version = RC17 producer.use { p => p.sendStream(Stream(events: _*)) .foreach(_ => ...) } // ZIO version > RC17 producer.use { p => Stream(events: _*) .via(p.sendStream) .foreach(_ => ...) }
- returns
stream with published events.
-
abstract
def
sendStreamE: (Stream[Throwable, ProducerEvent[T]]) ⇒ ZStream[Any, Throwable, ErrorOrEvent[T]]
Stream that takes the events and produces a stream with the results.
Stream that takes the events and produces a stream with the results.
- returns
stream with published events or errors zio.sqs.producer.ErrorOrEvent. Task completes when all input events were processed (published to the server or failed with an error).
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()