Questions tagged [lwt]

LWT, usually referring to lightweight threads, is a poorly defined term. Prefer instead to use [ocaml-lwt] for the OCaml library, [lightweight-processes], [green-threads] or one of the more specific tags listed in the tag wiki.

The term "lightweight threads" is poorly defined and might refer to a number of different concepts. Prefer instead to use one of these tags:

26 questions
1
vote
1 answer

How to fully utilise lwt_pool?

I am struggling at the check and validate function for Lwt_pool.create and have some questions here. val create : int -> ?check:('a -> (bool -> unit) -> unit) -> ?validate:('a -> bool Lwt.t) -> (unit -> 'a Lwt.t) -> 'a t First of all, let…
Jackson Tale
  • 25,428
  • 34
  • 149
  • 271
0
votes
0 answers

Lwt error sending messages with capnproto

I am using capnproto to send messages between several nodes. Each node can both send and receive messages from all others. The relevant code looks like this: main.ml: let start_node id nodes = Lwt_main.run begin let listen_address = `TCP…
Melkor
  • 779
  • 1
  • 12
  • 29
0
votes
1 answer

This expression has type H2_lwt_unix.Client.t but an expression was expected of type 'weak702 Lwt.t

How to deal with 'a Lwt objects in a function? My code is Array.map (fun conn -> let* resp = (call_server conn (RequestVoteArg({ candidateNumber = myState.myPersistentState.id; term =…
Murphy
  • 47
  • 7
0
votes
1 answer

How to Check Device is Status with AWS Iot Core with AWS Android SDk

I am created Android application communicate with AWS Iot Core using AWS Android SDK its perfectly working but If Device is disconnected while power or internet problem, I want to show status of Device is Connected or Disconnected, I found one using…
Arasan
  • 13
  • 5
0
votes
1 answer

LWT installation failed using OPAM

LWT installation failed using OPAM on Ubuntu Server Information - Distributor ID: Ubuntu, Description: Ubuntu 18.04.4, LTS Release: 18.04, Codename: bionic Steps I followed - opam list -a # List the available packages opam…
joydeba
  • 778
  • 1
  • 9
  • 24
0
votes
0 answers

Cassandra lightweight transactions failing

There are 2 DCs each with 3 nodes, and the RF used for writes is 2 and reads its each_quorum. A lightweight transaction is used to ensure consistency of updates across DCs. Now what is happening is for certain records, hundreds (maybe thousands) of…
nmakb
  • 1,069
  • 1
  • 17
  • 35
0
votes
1 answer

LWT and Consisteny in Cassandra

It seems to be the bug for me, 1) I created a keyspace with replication factor as '3' CREATE KEYSPACE IF NOT EXISTS replicationtest WITH replication = {'class':'SimpleStrategy','replication_factor' : 3}; NOTE: This is a single node cluster, still…
Harry
  • 3,072
  • 6
  • 43
  • 100
0
votes
0 answers

Calling Lwt_process.pread_lines multiple times

I'm trying to use Lwt_process.pread_lines to get the output of a few commands. In my Lwt_main.run I call it once, and start processing each line of output separately though Lwt_stream.map, which works well. In that processing though, if I call…
Ulrar
  • 895
  • 8
  • 17
0
votes
1 answer

Cassandra LWT ReadTimeoutException or WriteTimeoutException

I am trying to have two process insert in the same table. So first I try to enter the partition and clustering key values with a LWT if this succeeds it means the process can continue with that work for that time bucket otherwise another process…
Fabio
  • 555
  • 3
  • 9
  • 24
0
votes
1 answer

Redirecting Lwt channels

I have a ssh service running on an Unix socket and I have a local TCP server for which I'm wanting to have it be directed toward the channels of the unix socket. Basically when I do: $ ssh root@localhost -p 2000 Then my local TCP server get the…
user1971598
0
votes
2 answers

Compiling program that uses Lwt_term

I have the following code in OCaml: open Lwt open Lwt_term let () = Lwt_main.run ( lwt l = Lwt_read_line.read_line ~prompt:[text "foo> "] ()) when I try to compile using ocamlfind ocamlc -package lwt cli.ml - o cli.byte it I get the following…
Sergi Mansilla
  • 12,495
  • 10
  • 39
  • 48
1
2