Iteration RevisitedIdea: generalise iteration by index, rather than by pointer 24ITERATION REVISITED FLUX ▸ Flux (github.com/tcbrindle/flux) is a C++20 library exploring these ideas ▸ Aims: ▸ Much improved safety by default ITERATION OPERATIONS WITH FLUX ▸ flux�::first(seq) returns a cursor, which represents a sequence position ▸ For contiguous sequences, this is just an integer index ▸ flux�::is_last(seq, cur) returns the cursor is past-the-end ▸ flux�::read_at(seq, cur) accesses the element at the cursor position ▸ flux�::inc(seq, cur) increments the cursor 26ITERATION REVISITED FLUX CONCEPTS ▸ A type which provides0 码力 | 56 页 | 5.27 MB | 6 月前3
Spring Framwork Web on Reactive Stack v5.3.36 SNAPSHOTreactive library of choice for Spring WebFlux. It provides the Mono and Flux API types to work on data sequences of 0..1 (Mono) and 0..N (Flux) through a rich set of operators aligned with the ReactiveX vocabulary plain Publisher as input, adapts it to a Reactor type internally, uses that, and returns either a Flux or a Mono as output. So, you can pass any Publisher as input and you can apply operations on the ServerCodecConfigurer bean (see the Web Handler API). To parse multipart data in streaming fashion, you can use the Fluxreturned from an HttpMessageReader instead. For example, in an annotated controller, 0 码力 | 182 页 | 2.52 MB | 1 年前3
Spring Framwork RSocket v5.3.36 SNAPSHOTReactor simplifies the job of implementing the protocol. For applications it is a natural fit to use Flux and Mono with declarative operators and transparent back pressure support. The API in RSocket Java models the four request interaction types with Mono representing a promise for a single message, Flux a stream of messages, and io.rsocket.Payload the actual message with access to data and metadata have a client or server requester, you can make requests as follows: Java ViewBox viewBox = ... ; Fluxlocations = requester.route("locate.radars.within") ① .data(viewBox) ② 0 码力 | 19 页 | 279.85 KB | 1 年前3
《Slides Dev Web》 08 . RSSplusieurs médias • Dans les journaux : dépêches, bandes dessinées, … • Télévision : jeux, séries • Web : Flux RSS / Atom – 1 source de donnée, plusieurs abonnés – Contenu : news, blogs, podcast, … – Accès unique unique à plusieurs sources d’informations – Mises à jour fréquentes Historique • Feed (fil ou flux) RSS • Format d’échange de données en XML – fournir ou recueillir des données structurées • Utilisation wikipedia.org/wiki/Comparison_of_feed_aggregators 2 Générer un flux RSS • Fichier XML : – Canal / Items (RSS) – Entrées (Atom) • Indiquer le flux au navigateur • Permettre l’abonnement : logo visible dans0 码力 | 7 页 | 52.98 KB | 1 年前3
C++20 Modules: The Packaging and Binary Redistribution Storyof the importers import fmt; fmt.cxx fmt.pcm fmt.oCompilation time #include <flux.hpp> took 319 ms import flux; took 14 msYour imports (can) have imports export module foo; import bar; the gate for a mechanical issue compilation terminated.BMI compatibility (cont’d) add_subdirectory(flux) add_subdirectory(fmt) add_subdirectory(argparse) add_library(foo) target_sources(foo PUBLIC foo fmt::fmt flux::flux argparse::argparse) /lib/llvm-16/bin/clang++ -I/usr/lib/gcc/aarch64-linux-gnu/12/include -I/cxx-modules/cmake-example/fmt/include -I/cxx-modules/cmake-example/flux/include -O30 码力 | 76 页 | 2.09 MB | 6 月前3
Spring Framwork Language Support v6.0.0-M2experience overall. To retrieve a list of User objects in Java, you would normally write the following: Fluxusers = client.get().retrieve().bodyToFlux(User.class) With Kotlin and the Spring Framework following: val users = client.get().retrieve().bodyToFlux () // or (both are equivalent) val users : Flux = client.get().retrieve().bodyToFlux() As in Java, users in Kotlin is strongly typed, but Kotlin’s the Mono can be empty or not (with the advantage of being more statically typed) • fun handler(): Flux becomes fun handler(): Flow For input parameters: • If laziness is not needed, fun handler(mono: 0 码力 | 42 页 | 602.76 KB | 1 年前3
Spring Framwork Language Support v5.3.36 SNAPSHOTexperience overall. To retrieve a list of User objects in Java, you would normally write the following: Fluxusers = client.get().retrieve().bodyToFlux(User.class) With Kotlin and the Spring Framework following: val users = client.get().retrieve().bodyToFlux () // or (both are equivalent) val users : Flux = client.get().retrieve().bodyToFlux() As in Java, users in Kotlin is strongly typed, but Kotlin’s the Mono can be empty or not (with the advantage of being more statically typed) • fun handler(): Flux becomes fun handler(): Flow For input parameters: • If laziness is not needed, fun handler(mono: 0 码力 | 42 页 | 603.79 KB | 1 年前3
Spring Framwork Web on Servlet Stack v5.3.36 SNAPSHOTsingle value type, e.g. Mono, is comparable to returning DeferredResult. A multi-value type, e.g. Flux, may be treated as a stream depending on the requested media type, e.g. "text/event- stream", " ResponseEntity<Flux> make the response status and headers 66 known immediately while the body is provided asynchronously at a later point. Use Mono if the body consists of 0..1 values or Flux if it can similar to using ResponseBodyEmitter or SseEmitter. Examples include Flux (Reactor) or Observable (RxJava). Applications can also return Flux or Observable . • A multi-value 0 码力 | 259 页 | 3.58 MB | 1 年前3
Spring Framwork Data Access v5.3.36 SNAPSHOTinterface that we want to make transactional package x.y.service; public interface FooService { FluxgetFoo(String fooName); Publisher getFoo(String fooName, String barName); Mono package x.y.service; public class DefaultFooService implements FooService { @Override public Flux getFoo(String fooName) { // ... } @Override public Publisher getFoo(String consider the operators used downstream from a transaction Publisher. In particular in the case of a Flux or other multi-value Publisher, the full output must be consumed to allow the transaction to complete 0 码力 | 197 页 | 2.76 MB | 1 年前3
Spring Boot 3.0.1 Reference Documentation the Spring MVC model, as shown in the following example: 262 Java import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import org.springframework.web.bind.annotation.DeleteMapping; return this.userRepository.findById(userId); } @GetMapping("/{userId}/customers") public FluxgetUserCustomers(@PathVariable Long userId) { return this.userRepository.findById(userId) RequestMapping import org.springframework.web.bind.annotation.RestController import reactor.core.publisher.Flux import reactor.core.publisher.Mono @RestController @RequestMapping("/users") class MyRestController(private 0 码力 | 877 页 | 15.68 MB | 1 年前3
共 144 条
- 1
- 2
- 3
- 4
- 5
- 6
- 15













