Am Freitag, 7. Oktober 2016 22:06:26 UTC+2 schrieb Justin du coeur:
>
> When the player wants to move, the Player Actor sends an "I'd like to move
> to X" message to the Space Actor responsible for that location, and the
> Space returns either a "yes, go ahead, you now own that position" or
You can still pattern match on the type, like so:
case result: SomeType => complete(result)
--
Johan
Akka Team
On Fri, Oct 7, 2016 at 4:30 PM, Richard Rodseth wrote:
> You're right the types are different, and PimpedResult is not a case class
> so pattern matching
You're right the types are different, and PimpedResult is not a case class so
pattern matching doesn't work out. I think I must abandon this approach and
mimic Heiko's.
Was hoping to ease the port from Spray but
this BinTray contribution is too complex.
Sent from my phone - will be brief
> On
So this:
On Fri, Oct 7, 2016 at 11:28 AM, Steve Winfield <
mail.stevewinfi...@gmail.com> wrote:
> I want everything to be synchronized
>
is something you basically have to give up -- global synchronization is
fundamentally contradictory to the Actors view of the world. Mind, though,
it doesn't
I found my (stupid) problem. I had used:
val encryptedOut = Sink.head[ByteString]
instead of:
val encryptedOut: Sink[ByteString, Future[ByteString]] = Sink.fold[ByteString,
ByteString](ByteString())(_ ++ _)
Consequently, only the first chunk of the stream was being kept. I’m not
entirely
I wrote a simple test case using a graph rather than using src.runForEach.
"CipherStage in graph" should "work" in {
val clearText = "0123456789abcdef"
val clearSource = Source.single(ByteString(clearText))
val encryptedOut = Sink.head[ByteString]
val encodedKey: String =
If you groupBy with an upper bound of substreams at Int.MaxValue you can at
some point have more than 256 substreams, which is what you limit
mergeSubstreamsWithParallelism with, this means that it will backpressure
indefinitely (as none of the substreams will complete until upstream
completes and
Can you post a minimal reproducer?
On Fri, Oct 7, 2016 at 9:02 PM, Eric Swenson wrote:
> I wrote a simple test for my CipherStage and it appears to work fine:
>
> "CipherStage" should "work" in {
> val clearText = "0123456789abcdef"
> val clearSource =
To be fair you are doing something pretty complex with them, but I agree,
the magnet pattern definitely can be humbling.
Did the code that worked just fine earlier really deal with the exact same
type (tuple with statuscode and APIError)?
--
Johan
Akka Team
On Fri, Oct 7, 2016 at 1:30 PM,
There are no requirements from Akka HTTPs side limiting how you create your
Route instances at all (Please let us know if the documentation says so
anywhere).
Additionally all built in directives are available statically.
So for extra clarity, you can (and likely should) do:
import static
Heiko has a different approach here
https://github.com/hseeberger/reactive-flows/blob/master/src/main/scala/de/heikoseeberger/reactiveflows/Api.scala
onSuccess(flowFacade ? addFlow) {
case bc: BadCommand => complete(BadRequest -> bc)
case fe: FlowExists => complete(Conflict -> fe)
case fa:
Isn't it true that your routes need to be in a trait t be able to make use
of the Routing Testkit?
On Fri, Oct 7, 2016 at 12:08 PM, wrote:
> Thank you for the response Johan but I'm not sure that really answers my
> question but perhaps I can ask some other questions
That's the trouble. Depending on whether the actor calls withStatusCode, it
could be a Result or a PimpedResult. Both can be marshalled.
In the Spray application we completed the request inside a per-request
actor. That is no longer possible, hence using Ask.
On Fri, Oct 7, 2016 at 11:18 AM,
In general, don't try to mimic the way it is done in Akka HTTP itself
unless you actually have the same requirements. (To support both mixin and
static imports, dealing with both a Scala and Java API etc)
Modularising the routes is not different from modularising other kinds of
codebases, you
If you know the type of the expected response from the ask, then you use
`mapTo` on the returned Future to coerce it.
On Fri, Oct 7, 2016 at 5:55 PM, Richard Rodseth wrote:
> Continuing my struggles to port something we did with Spray, using
>
> // See
Hi Richard,
You can combine ask with mapTo to cast it to the right type (or fail the
future if it does not have that type), see the docs here:
http://doc.akka.io/docs/akka/2.4/scala/futures.html#use-with-actors
--
Johan
Akka Team
On Fri, Oct 7, 2016 at 10:55 AM, Richard Rodseth
happy hakking!
On Fri, Oct 7, 2016 at 4:50 PM, Jegan wrote:
> Thanks friends. I tried the options suggested by both of you. Both are
> working great.
>
> On Friday, October 7, 2016 at 7:23:05 AM UTC-7, √ wrote:
>>
>> pipeTo
>>
>> On Fri, Oct 7, 2016 at 4:17 PM, Justin du
Continuing my struggles to port something we did with Spray, using
// See https://bitbucket.org/binarycamp/spray-contrib/src
I have resolved my implicit conversion errors to the point where I can
execute the following (Result[T] is an alias for Either[APIError, T]):
val successResult:
As you have a finite stream of customer ids the stream will complete after
all elements has been processed. If your actual business problem does in
fact look like this though, it may make sense to not involve Akka Streams
at all and just use the regular Scala collection API to achieve the same.
I'm not familiar with Java API but my impression is that AllDirectives is a
device for bringing all pre-defined directives in scope of your Route
producing functions.
Routes themselves are values and you can combine them to produce more
complex routes. For example you could have several classes
A quick google search doesn't turn up any Scala specific libraries so you
are probably best off using one of the Java libraries listed on the XMPP
homepage (http://xmpp.org/software/libraries.html) to interact with XMPP
from the JVM.
If you decide to use Akka Streams as the abstraction (which
Thanks friends. I tried the options suggested by both of you. Both are
working great.
On Friday, October 7, 2016 at 7:23:05 AM UTC-7, √ wrote:
>
> pipeTo
>
> On Fri, Oct 7, 2016 at 4:17 PM, Justin du coeur > wrote:
>
>> This is kind of the number-one FAQ for Akka: you must
pipeTo
On Fri, Oct 7, 2016 at 4:17 PM, Justin du coeur wrote:
> This is kind of the number-one FAQ for Akka: you must never, ever use
> "sender" in the results of a Future. "sender" is only set *synchronously*,
> while the receive method is running -- after that (in your
This is kind of the number-one FAQ for Akka: you must never, ever use
"sender" in the results of a Future. "sender" is only set *synchronously*,
while the receive method is running -- after that (in your Future's
onComplete), it's probably not set to anything, and *might* be set to
something
Hi everyone,
Actually i was trying to handle a Web Socket message for base64 encoded
string of 10mb file.but unable to handle it.
is there any way to handle large message please suggest ?
Here is the code:
def mediaUploadHandler: Flow[Message, Message, _] = {
val (accountSource,
Hello Friends,
I need your help in figuring out what is going wrong here. I have posted
this question in SO too.
I am using Akka Cluster (version 2.4.10) with few nodes designated for
"front-end" role and few others as "workers". The workers are on remote
machines. The incoming work is
26 matches
Mail list logo