Git Product home page Git Product logo

monix-connect's Introduction

Monix

Asynchronous, Reactive Programming for Scala and Scala.js.

monix Scala version support

Build Gitter Discord

Overview

Monix is a high-performance Scala / Scala.js library for composing asynchronous, event-based programs.

It started as a proper implementation of ReactiveX, with stronger functional programming influences and designed from the ground up for back-pressure and made to interact cleanly with Scala's standard library, compatible out-of-the-box with the Reactive Streams protocol. It then expanded to include abstractions for suspending side effects and for resource handling, and is one of the parents and implementors of Cats Effect.

A Typelevel project, Monix proudly exemplifies pure, typeful, functional programming in Scala, while being pragmatic, and making no compromise on performance.

Highlights:

  • exposes the kick-ass Observable, Iterant, Task, IO[E, A], and Coeval data types, along with all the support they need
  • modular, split into multiple sub-projects, only use what you need
  • designed for true asynchronicity, running on both the JVM and Scala.js
  • excellent test coverage, code quality, and API documentation as a primary project policy

Usage

Library dependency (sbt)

For the stable release (compatible with Cats, and Cats-Effect 2.x):

libraryDependencies += "io.monix" %% "monix" % "3.4.1"

Sub-projects

Monix 3.x is modular by design. See the sub-modules graph:

Sub-modules graph

You can pick and choose:

  • monix-execution exposes the low-level execution environment, or more precisely Scheduler, Cancelable, Atomic, Local, CancelableFuture and Future based abstractions from monix-catnap.
  • monix-catnap exposes pure abstractions built on top of the Cats-Effect type classes; depends on monix-execution, Cats 1.x and Cats-Effect
  • monix-eval exposes Task, Coeval; depends on monix-execution
  • monix-reactive exposes Observable for modeling reactive, push-based streams with back-pressure; depends on monix-eval
  • monix-tail exposes Iterant streams for purely functional pull based streaming; depends on monix-eval and makes heavy use of Cats-Effect
  • monix provides all of the above

Documentation

See:

API Documentation:

(contributions are welcome)

Related:

Contributing

The Monix project welcomes contributions from anybody wishing to participate. You must license all code or documentation provided with the Apache License 2.0, see LICENSE.txt.

You must follow the Scala Code of Conduct when discussing Monix on GitHub, Gitter channel, or other venues.

Feel free to open an issue if you notice a bug, have an idea for a feature, or have a question about the code. Pull requests are also gladly accepted. For more information, check out the contributor guide.

If you'd like to donate in order to help with ongoing maintenance:

Adopters

Here's a (non-exhaustive) list of companies that use Monix in production. Don't see yours? Submit a PR โค๏ธ

License

All code in this repository is licensed under the Apache License, Version 2.0. See LICENSE.

monix-connect's People

Contributors

alexandru avatar avasil avatar borissmidt avatar cwgroppe avatar gkhotyan avatar livelxw avatar mattszm avatar paualarco avatar rfkm avatar scala-steward avatar t1707 avatar tapan-stb avatar tmkontra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

monix-connect's Issues

Add release process

Add the needed sbt configurations to start releasing artifacts to the Sonatype Nexus Repository. As well as adding git version tag for each of the releases.
Project's version would remain "0.x" until project is stable and this feature have been tested a couple of times to make sure deployment is done correctly.

Type safe MongoDB results

Some of the opertation of MongoOp does return directly the results received by the uderlying mogodb reactive streams interface. We should create conversions to specific scala classes that provides safe access to these results.

Example:
When performing replace or updates it returns an option com.mongodb.client.result.UpdateResult
This object has three fields in which two of them are nullable, which might cause a NullPointerException when when trying to access them.

@nullable final Long modifiedCount,
@nullable final BsonValue upsertedId

AWS S3 Benchmarks

Create aws S3 benmchmarks and compare it with other existing scala integrations.

Redis Benchmarks

Create redis benmchmarks and compare it with other existing scala redis integrations.
See redis4cats, laserdisc, zio-redis...

Refine Redis connector

  • Split Redis api in smaller groups (Hash, List, Sets, Streams...)
  • Create at least one integration test for each the modules mentioned above
  • Unit test for all of the redis operations
  • Update documentation with an examples for each of the redis api

Parquet - HDFS and S3 Parquet tests and examples

This is a non priority issue but would be cool for the user to have examples on how to write parquet files to hdfs and s3 using the parquet connector, that would imply writing functional tests that cover that.

Remove Common Submodule

This submodule currently only have an implementation of monix transformer that is only being used for the DynamoDb connector.
As part of this issue would be to consider bringing back the signature in monix project.
See current status

Google Cloud Storage

I am opening this issue to track it's progress, will have an initial PR up for review within the week.

Refine DynamoDb connector

  • Fix DynamoDb integration tests failing in the pipeline (but working locally)
  • Add unit tests
  • Update / improve documentation with examples
    -Implementation of pending dynamodb request/response operations

AWS DynamoDB Benchmark

Create AWS DynamoDb benmchmarks and compare it with other existing scala integrations.

Improve test coverage of Parquet connector

The parquet connector implements two main signatures (writer and reader).

We would like to see more test cases for those, like:

  • Testing scenario where the stream does not emit any records.
  • Consuming from a failed observable.
    ...

Redis - Revise and correct methods that potentially can return `null` values

monix-redis is built on top of lettuce, and some of their methods can return a null values instead of the expected one, which makes it unsafe and not reliable.

An example of this is the hget from the Hash api (this one is already corrected, but there are more, and the idea was to identify these methods that can potentially return null and wrap them with Option.

Currently the methods have unit-tested under test, on the other handit contains functional tests that runs agains a redis docker container. But these just cover a few examples.

A way of ensuring that no null values are returned would be to add functional tests that handles different scenarios.
So in case of hget , it would return null when called for a key and field that does not exist.

A good way to find the methods that returns values is by directly checking the underlying api documentation.

Failed Redis Integration test

should allow to compose nice for comprehensions *** FAILED ***
List("1684", "1779", "2465", "2910", "3066", "3921", "4441", "6315", "6865", "8213", "8941", "9138", "9977") did not contain the same elements as List("2465", "2910", "3066", "1684", "9977", "4441", "3921", "8213", "9138", "6315", "1779", "8941", "9977", "6865") (RedisIntegrationTest.scala:177)

Parquet writer unsafe

@Avasil would it make sense to align the naming convention of parquet writer with the reader one and have:

def toWriterUnsafe[T](writer: ParquetWriter[T])

So then in the future also have:

def writer[T](writer: ParquetWriter[T])

and

def read[T](reader: Task[ParquetReader[T]])

?

Refine S3 connector

  • Multipart update needs to support more than one element.
    -Add testing coverage for all s3.
  • Compare the Monix S3 api with the S3AsyncClient one to see if there is any methods missing.

Fix Apache Parquet API docs

When adding apache parquet submodule to the list of projects to generate api docs:
unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(akka, dynamodb, hdfs, redis, s3, **parquet**),

Then it fails when attempting to create docs (sbt docs/docusaurusCreateSite) with the following failure:

monix-connect/parquet/target/scala-2.12/src_managed/main/monix/connect/parquet/test/user/ProtoDoc.scala:109:29: value readStringRequireUtf8 is not a member of com.google.protobuf.CodedInputStream [error] __name = _input__.readStringRequireUtf8()
[error] (docs / Scalaunidoc / doc) Scaladoc generation failed

GCS Benchmark

Create Google Cloud Storage benmchmark and compare it with other existing integrations.

GCS integration tests

This issue is aimed to add local integration tests for the Google Cloud Storage Connector.

We have not find a good way to do so apart of mocking the google services, we would rather use a docker image or a more reliable emulator:

There are some examples used in python:
https://github.com/googleapis/python-storage
googleapis/google-auth-library-python#206 (Python Anonymous Auth)
https://github.com/fsouza/fake-gcs-server/blob/main/examples/python/python.py (Example in python)

Other related links:
googleapis/google-cloud-java#7184
https://github.com/googleapis/java-storage
googleapis/google-auth-library-java#449 (Posted issue)

Web documentation

Migrate current documentation from project's readme to a web version in monix.io/connect/.

Fix Flaky DynamoDb integration test

A sample pipeline failure: https://github.com/monix/monix-connect/runs/942214521?check_suite_focus=true

[info] monix.connect.dynamodb.DynamoDbOp$@124d9fc6 exposes a create method that
[info] - defines the execution of any DynamoDb request *** FAILED ***
[info] software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException: Cannot do operations on a non-existent table (Service: DynamoDb, Status Code: 400, Request ID: null)
[info] at software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException$BuilderImpl.build(ResourceNotFoundException.java:118)
[info] at software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException$BuilderImpl.build(ResourceNotFoundException.java:78)
[info] at software.amazon.awssdk.protocols.json.internal.unmarshall.AwsJsonProtocolErrorUnmarshaller.unmarshall(AwsJsonProtocolErrorUnmarshaller.java:88)
[info] at software.amazon.awssdk.protocols.json.internal.unmarshall.AwsJsonProtocolErrorUnmarshaller.handle(AwsJsonProtocolErrorUnmarshaller.java:63)
[info] at software.amazon.awssdk.protocols.json.internal.unmarshall.AwsJsonProtocolErrorUnmarshaller.handle(AwsJsonProtocolErrorUnmarshaller.java:42)
[info] at software.amazon.awssdk.core.internal.http.async.AsyncResponseHandler.lambda$prepare$0(AsyncResponseHandler.java:88)
[info] at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072)
[info] at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
[info] at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
[info] at software.amazon.awssdk.core.internal.http.async.AsyncResponseHandler$BaosSubscriber.onComplete(AsyncResponseHandler.java:129)

Redis - Remove lettuce types dependencies

Currently, monix redis connector exposes lettuce specific types that are needed for performing redis commands.
Would be great to study if we can define our own types and conversions from and forth.

So as a result, the user would not have to deal with these, neither for passing them as parameter to functions nor when getting it as result.

The aim is to reduce the user having to import the less monix external types as possible and to make the api more scala like. (No builders, use companion objects etc.)

Some examples of these might be found along the different Apis:

import io.lettuce.core.{KeyValue, Limit, Range, ScoredValue, ScoredValueScanCursor, KeyScanCursor, StreamMessage}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.