Coder Social home page Coder Social logo

covenant's People

Contributors

cornerman avatar fabianhjr avatar fdietze avatar lolgab avatar scala-steward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

covenant's Issues

Unable to connect protobuf serialization

I am experimenting if we can use protobuf for serialization with covenant. I have created implicit chameleon Serde for argument as well as return types. But looks like that is not enough. I get the following error

could not find implicit value for parameter deserializer: chameleon.Deserializer[_sloth_SequenceFeeder_feed,java.nio.ByteBuffer]

Error does not tell me for which type a deserializer is missing. I am assuming that only argument and return types of the are required.

Add response header

We are using circe for serialization. It's working fine but we are getting response header as Content-Type: text/plain

We want response header to be 'content-type-application/json'. We tried setting header with responseWithHeaders() method. But akka http is giving error - Explicitly set HTTP header 'Content-Type: application/json' is ignored, explicit 'Content-Type' header is not allowed. Set 'HttpResponse.entity.contentType' instead.

But we don't have handle of response entity.

Any way to solve this?

overloaded method value apply with alternatives

I am trying to implement a simple request call.

object CovenantBackend {
  type Event = String
  type State = String
  case class ApiError(msg: String)
  object Dsl extends ApiDsl[Event, ApiError, State] {
    override def applyEventsToState(state: State, events: Seq[Event]): State = state + "" + events.mkString(",")
    override def unhandledException(t: Throwable): ApiError = ApiError(t.getMessage)
  }
  object ApiImpl extends Api[Dsl.ApiFunction] {
    import Dsl._
    override def getTrue: ApiFunction[Boolean] = Action(true)
  }
}

but I get this error:

overloaded method value apply with alternatives:
[error]   [T](f: => scala.concurrent.Future[covenantBackend.CovenantBackend.Dsl.ApiData.Action[T]])(implicit ec: scala.concurrent.ExecutionContext)covenantBackend.CovenantBackend.Dsl.ApiFunction[T] <and>
[error]   [T](f: covenantBackend.CovenantBackend.State => scala.concurrent.Future[covenantBackend.CovenantBackend.Dsl.ApiData.Action[T]])(implicit ec: scala.concurrent.ExecutionContext)covenantBackend.CovenantBackend.Dsl.ApiFunction[T]
[error]  cannot be applied to (Boolean)
[error]     override def getTrue: ApiFunction[Boolean] = Action(true)

Server does not close the stream after client disconnection.

I created a small repo where we can

  • run server as sbt "runMain streaming.StreamingServer"
  • run client as sbt "runMain streaming.JvmStreamingApp".

Even after I disconnect the client (ctrl-C), I see that server keeps producing the values and stream is not closed.

Is it expected? Should the server not close the Monix stream automatically once client is gone?

Release

Hi @cornerman, thanks a lot for this nice library. If you got around to doing a release that is available on Maven Central, I'd really appreciate it.

Disable logger on server side

I can't find how to disable the logger, covenant show me a lot of data in the client and in the server related to results

outdated libraries

I am trying to update some libraries:

I need to update this because errors happens with another library:

  //val scribe = dep("com.outr" %%% "scribe" % "2.7.13")
  val scribe = dep("com.outr" %%% "scribe" % "3.0.4")

and this because some compatibility with outwatch:

  val scalajs = new {
    val dom = dep("org.scala-js" %%% "scalajs-dom" % "2.0.0")
  }

but I am getting some errors when I do it.

[error] /home/elyphas/Prjs/mycelium/mycelium/js/src/main/scala/core/JsMessageBuilder.scala:40:33: type mismatch;
[error]  found   : Function1[org.scalajs.dom.UIEvent,promise.type] (in scala) 
[error]  required: Function1[org.scalajs.dom.ProgressEvent,_]      (in scala.scalajs.js) 
[error]     reader.onload = (_:UIEvent) => {
[error]                                 ^

this seems because jump from 1.0.0 to 2.0.0 on scalajs-dom.

Any idea, please

CORS error with JSClient

JVMClient is working as expected, but JSClient is giving us CORS error.

I guess adding Access-Control-Allow-Origin: * header in client request should fix it but could not find a way in the API to do so.

troubles with java.util.Date

I have an error:

WSCovenant.scala:28:40: could not find implicit value for parameter deserializer: chameleon.Deserializer[Either[String,List[GralDataPedido]],java.nio.ByteBuffer]
[error]   val api = client.sendWithDefault.wire[Api[Future]]
WebService.scala:59:84: could not find implicit value for parameter serializer: chameleon.Serializer[Either[String,List[GralDataPedido]],java.nio.ByteBuffer]
[error]   val router = Router[ ByteBuffer, Dsl.ApiFunction ].route[ Api[ Dsl.ApiFunction ]]( ApiImpl )

When I try to use the java.util.Date type in my case class

Any idea to solve this?
Thanks in advance!

Streaming API

Covenant looks awesome!

Are you also planning to support streaming API like gRPC?

I see that the project has Monix dependency but unable to wrap my head around how to write the most general streaming API like this:

def fun[T](input: Observable[T]): Observable[T]

I looked at the HttpSpec, but still figuring out if DslApiImpl allows that in some way.

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.