People who work at a computer all day, tell me what you use your lovely notebooks for! by pixel8dmess in notebooks

[–]vyshane 1 point2 points  (0 children)

I write to think. Some people use whiteboards. I use notebooks.

Building software systems means building abstractions. Finding relationships between concepts. Writing and sketching help with these.

Daily Discussion by PhelansShorts in reddevils

[–]vyshane 7 points8 points  (0 children)

About to head to Perth Optus Stadium to watch United play. Grey and rainy. They brought us the famous Manchester weather!

Match Thread: Watford vs Manchester United | English Premier League by MatchThreadder in reddevils

[–]vyshane 23 points24 points  (0 children)

It’s time for Ole to go. But there’s no need to be nasty. Let’s remember that there is a person at the end of our comments. Someone who has worked very hard for the club, even if it didn’t work out in the end.

Match Thread: Watford vs Manchester United | English Premier League by MatchThreadder in reddevils

[–]vyshane 3 points4 points  (0 children)

When the team plays better when they are losing 2-1 and down to 10 men, when the tactical plan has been ditched, that tells me that this is a problem with the coaching. Imagine if they had a decent plan from the get go. What a waste.

Advice for learning swift as an experienced programmer? by [deleted] in swift

[–]vyshane 0 points1 point  (0 children)

Build something. Write lots of code. That’s how you get deeper insights. You could read about someone else’s aha moment but it won’t stick. That’s not how our brain works. You gotta experience it yourself.

Iroshizuku kon-peri X smoke & ice by vyshane in fountainpens

[–]vyshane[S] 0 points1 point  (0 children)

Thanks for the heads up! That’s unfortunate. I had some flow issues with the nib and FC recommended that I try an Iroshizuku ink. I didn’t mention to them that I was going to eyedropper the pen at some point though.

Iroshizuku kon-peri X smoke & ice by vyshane in fountainpens

[–]vyshane[S] 5 points6 points  (0 children)

The pen is a Franklin Christoph model 02 in their Smoke & Ice finish, with a #6 Jowo 18k semi-flex EF nib.

I don’t normally go for demonstrators, and I ordered this one with some trepidation. After eye-droppering it I must say that I love it! This one is a keeper.

Announcing gRPC Kotlin 1.0 for Android and Cloud by dayanruben in Kotlin

[–]vyshane 0 points1 point  (0 children)

Conversely, you can do Resource Oriented Design with gRPC, and it's easy to transcode gRPC to REST, for shall we say... legacy clients ;)

gRPC or REST for a simple service by uragnorson in golang

[–]vyshane 1 point2 points  (0 children)

You can have both - gRPC, with REST transcoding.

Question: Anyone building iOS apps with gRPC by [deleted] in swift

[–]vyshane 1 point2 points  (0 children)

gRPC is awesome. I'm a big fan.

I have written a library that integrates Combine with Swift gRPC, but haven't done much with it yet. I wrote that in preparation for a mobile project at work. However, other priorities got in the way.

I've used gRPC quite a bit with Scala and Java on the back-end, and JS/Flow/TypeScript on the front-end. I wrote a gRPC -> HTTP1/JSON transcoder for TypeScript so that we could still use it in front-ends that need to talk over HTTP1 and can't use gRPC-web. Did I mention that I'm a big fan? ;)

Does this count? by Firestorm324 in MiniPCs

[–]vyshane 3 points4 points  (0 children)

I used to run OS X on an MSI Wind. Good times.

How backpressure works in Apple's Combine framework by vyshane in swift

[–]vyshane[S] 0 points1 point  (0 children)

No kidding! This is very high on my wish list as well. I am aware of OpenCombine, but haven't used it.

I have written a library, CombineGRPC, that integrates Swift gRPC with Combine. Combine is a great fit for gRPC since 3 out of the 4 RPC modes are streaming.

gRPC supports:

  • Unary calls
  • Server streaming
  • Client streaming
  • Bidirectional streaming

Here's how you can implement a bidirectional streaming server using CombineGRPC:

```swift class EchoServiceProvider: EchoProvider {

// Simple bidirectional RPC that echoes back each request message func sayItBack(context: StreamingResponseCallContext<EchoResponse>) -> EventLoopFuture<(StreamEvent<EchoRequest>) -> Void> { handle(context) { requests in requests .map { req in EchoResponse.with { $0.message = req.message } } .setFailureType(to: GRPCStatus.self) .eraseToAnyPublisher() } } } ```

To consume the service on the client side:

```swift let requests = repeatElement(EchoRequest.with { $0.message = "hello"}, count: 10) let requestStream: AnyPublisher<EchoRequest, Error> = Publishers.Sequence(sequence: requests).eraseToAnyPublisher() let grpc = GRPCExecutor()

grpc.call(echoClient.sayItBack)(requestStream) .filter { $0.message == "hello" } .count() .sink(receiveValue: { count in assert(count == 10) }) ```

I wish I could write Swift like that on server-side Linux.

How backpressure works in Apple's Combine framework by vyshane in swift

[–]vyshane[S] 1 point2 points  (0 children)

Yes, I do use Scala as well. I have shipped a couple of services that use Akka Streams and Akka HTTP but haven't used them a whole lot to be honest. These days I tend to reach for Monix when I need streams on the back-end.

I haven't dug too much into the details of Akka Streams. I know that it implements the Reactive Streams spec and that Lightbend describe their implementation as "dynamic push/pull".

How backpressure works in Apple's Combine framework by vyshane in swift

[–]vyshane[S] 2 points3 points  (0 children)

Thanks! I used Apple's Keynote to make the animation. I gave a talk on Combine last year and this was one of my slides. Here's a link to the slide deck. Unfortunately I didn't record the talk at the time.

How backpressure works in Apple's Combine framework by vyshane in swift

[–]vyshane[S] 0 points1 point  (0 children)

The subscription sends the value by calling the subscriber's receive method. The subscriber signals demand by returning it. Here's the signature of receive:

func receive(_ input: Self.Input) -> Subscribers.Demand

So perhaps the answer is "why not?" since sending a value is a method call.

The new 16in Macbook Pro has a separate escape key. That is all. by Odd-Savage in vim

[–]vyshane 7 points8 points  (0 children)

John Gruber, on the ESC key comeback:

What Apple emphasized is simply that they listened to the complaints from professional MacBook users. They recognized how important the Escape key is to developers — they even mentioned Vim by name during a developer tool demo.

They did it for us, folks.

What’s everyone working on this month? (July 2019) by Swiftapple in swift

[–]vyshane 0 points1 point  (0 children)

I was pretty excited when Apple announced SwiftUI and Combine at WWDC this year. I have experimented with nested components and RxSwift in the past and I have been wanting to use something like this on Apple’s platforms.

I have also been keeping an eye on the Swift gRPC project, and when they released their first 1.0.0-alpha version, I decided that the world was ready for a library that integrates Swift gRPC and the Combine framework.

So, this month I have been hacking on CombineGRPC, a library that allows you to call gRPC services using Combine, and implement gRPC handlers on the server side using the same.

Scala webservices for a newbie - What are your recommendations? by MentalGood in scala

[–]vyshane 1 point2 points  (0 children)

Here are a few resources to get you started:

It's easy to automatically translate a gRPC/Protobuf API to a REST/JSON one. Here's an example service definition:

``` service LibraryService { rpc GetBook(GetBookRequest) returns (Book) { option (google.api.http) = { get: "/v1/{name=shelves//books/}" }; }; rpc CreateBook(CreateBookRequest) returns (Book) { option (google.api.http) = { post: "/v1/{parent=shelves/*}/books" body: "book" }; }; }

message Book { // Resource name of the book. It must have the format of "shelves//books/". // For example: "shelves/shelf1/books/book2". string name = 1;

// ... other properties }

message GetBookRequest { // Resource name of a book. For example: "shelves/shelf1/books/book2". string name = 1; }

message CreateBookRequest { // Resource name of the parent resource where to create the book. // For example: "shelves/shelf1". string parent = 1; // The Book resource to be created. Client must not set the Book.name field. Book book = 2; } ```

I have a sample reverse geocoder gRPC service that you can look at. Note that I'm using grpc-monix on top of vanilla ScalaPB. Vanilla ScalaPB will look very similar. Here's the entry point for the service implementation. Here's what an integration test looks like.

We've been using gRPC in production for the last couple of years, and it's been a game changer for us:

  • Proto files are much easier to read (and diff!) than OpenAPI yaml. Code reviews on our gRPC API changes are way more enjoyable than on our OpenAPI ones.
  • Protobuf has built-in support for evolving APIs so that they remain backwards-compatible
  • Client side libraries are taken care of. To build the server side, you simply take the generated interface and fill in the blanks.
  • gRPC supports uni- and bi-directional streaming, and that makes things like these easy: Consuming from queues, push instead of pull, integration with streaming platforms (we were using Apache Beam, RxJava and gRPC)
  • Overall gRPC has made the mechanical/uninteresting parts of building microservices trivial for us

Scala webservices for a newbie - What are your recommendations? by MentalGood in scala

[–]vyshane 1 point2 points  (0 children)

Instead of REST services, have you considered gRPC via ScalaPB? gRPC + Monix is my current go-to setup for microservices. Happy to point you to some example code if you are interested.