Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tradução capítulo 11 #465

Open
wants to merge 3 commits into
base: 3rd
Choose a base branch
from
Open

Conversation

ggarber42
Copy link

@ggarber42 ggarber42 commented May 8, 2021

@joaostein coloquei a pull pra versão 3 e mantive as modificações indicadas da PR.

Verifica se agora a estrutura está de acordo e qualquer coisa me avisa.

#410

Copy link
Contributor

@joaostein joaostein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ggarber42 segunda leva de reviews. alguns typos.

11_async.md Outdated Show resolved Hide resolved
11_async.md Outdated Show resolved Hide resolved
11_async.md Outdated Show resolved Hide resolved
11_async.md Outdated Show resolved Hide resolved
11_async.md Outdated Show resolved Hide resolved
11_async.md Outdated Show resolved Hide resolved
11_async.md Outdated Show resolved Hide resolved
11_async.md Outdated Show resolved Hide resolved
11_async.md Outdated Show resolved Hide resolved
11_async.md Outdated Show resolved Hide resolved
@ggarber42 ggarber42 requested a review from joaostein July 18, 2021 14:52
Copy link
Contributor

@joaostein joaostein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seguem algumas indicações para ajustes. Lembre-se de verificar os espaços duplos (muitas ocorrências) e os ``.

11_async.md Outdated Show resolved Hide resolved
be represented by ((value))s. In the case of asynchronous actions, you
could, instead of arranging for a function to be called at some point
in the future, return an object that represents this future event.
O quarto argumento dado ao tratador, `done`, é a função de _callback_ que precisa ser chamada quando a _request_ termina. Se tivéssemos utilizado o retorno do tratador como resposta, isso iria significar que o tratador não pode por si só performar uma atividade assíncrona. Uma função realizando um trabalho assíncrono geralmente irá retornar antes do trabalho terminar, tendo que fazer um arranjo para que o _callback_ seja chamada quando for completado. Portanto, iremos precisar de algum mecanismo assíncrono, nesse caso outra função _callback_ para sinalizar quando a resposta for válida.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

irá retornar -> irá retornar (dois espaços)

11_async.md Outdated
function that is mapped over the set of neighbors to turn them into
request promises attaches handlers that make successful requests
produce `true` and rejected ones produce `false`.
Quando um vizinho não está disponível, nós não queremos que o conjunto de todas as _promises_ fracasse, já que assim ainda não saberiamos de nada. Então, a função que é mapeada em cima do conjunto de vizinhos para os tornar _requests_ de _promises_ vínculadas ao uma tratador que faz _requests_ que fazem _requests_ bem sucedidas produzem um valor `true` e as rejeitadas produzem um valor `false`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faltou este.

11_async.md Outdated
define this array, we use the `everywhere` function—which runs code on
every nest—to add a property to the nest's `state` object, which is
where we'll keep nest-local state.
Para evitar enviar a mesma mensagem pela rede para sempre, cada ninho possui um _array_ de _strings_ de fofocas que já foram enviadas. Para definir esse _array_, nós utilizamos a função `everywhere`, que executa o código em cada ninho, para adicionar a propriedades ao `state` do ojeto `nest`, o qual iremos armazenar o estado do ninho local.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faltou este

11_async.md Outdated
arrays, will return true only when the two are the exact same value,
which is not what we need here. Comparing the JSON strings is a crude
but effective way to compare their content.
A comparação utiliza `JSON.stringify` porque ==, em objetos ou _arrays_, irá retornar verdadeiro apenas quando os dois são exatamente o mesmo valor, o que não precisamos. Compar as _strings_ de JSON é um jeito cru, mas efetivo de comparar seu conteúdo.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faltou este

11_async.md Outdated
succeeds, yielding an array of result values. If a promise
in the array fails, the promise returned by `all` fails too, with the
failure reason from the failing promise.
Dado um _array_ de _promises_, `Promise.all` retorna uma _promise_ que espera que todas as _promises_ do _array_ terminarem. Se é bem sucedida, gera um _array_ dos valores dos resultados. Se uma _promise_ no _array_ falha, a _promise_ retornada por `all` fracassa também, com a falha sendo a da _promise_ que falhou.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arrumar os espaços adicionais

11_async.md Outdated
succeed or fail again, and further calls to the functions that resolve
it are ignored. This can simplify the way you handle failure of your
promise.
Lembrando que depois da _promise_ ter sucesso ou falhar, ela não pode ter sucesso ou fracassar novamente, em próximas chamadas para funções que as resolvem são ignoradas. Isso pode simplificar a forma como você trata a falha da sua _promise_.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depois da _promise_ -> remover espaço adicional

11_async.md Outdated
stored in the correct position of a result array, and we must check
whether this was the last pending ((promise)) and finish our own
promise if it was.
A função para o construtor da `Promise` vai ter que chamar o `then` de cada _promise_ no dado _array_. Quando uma for bem sucedida, duas coisas precisam acontecer. O valor resultando precisa ser armazenado na posição correta no _array_ resultante, e precisa verificar se esse é o último valor pendente da _promise_ e terminar a própria _promise_ se for.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

construtor da Promise -> remover espaço adicional

11_async.md Outdated
each of the promises in the array as a `catch` handler or as a second
argument to `then` so that a failure in one of them triggers the
rejection of the whole wrapper promise.
A última pode ser feita com um contador que é inicializado com o comprimento do _array_ de entrada e do qual nós subtraímos 1 cada vez que a _promise_ é bem sucedida. Quando atinge 0, nós terminamos. Garante que você vai levar em conta a situação em que a entrada do _array_ for vazio (assim nenhuma _promise_ vai ser resolvida).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

com um contador que é -> remover espaço adicional

11_async.md Outdated

Assincronicidade possui aspectos positivos e negativos. Torna fazer programas que não se encaixam no modelo de linha reta mais fácil, porém faz com programas que seguem esse modelo linha reta fiquem mais estranhos. Vamos ver formas essa estranheza mais tarde neste capítulo.

Ambas as plataformas de programação importantes de Javascript — navegador (_browser_) e Node.js — fazem operações que podem ser assíncronas, ao invés de utilizarem fios. E como programação com fios é notoriamente difícil (entender o que um programa faz é muito mais complicado quando ele faz mais de uma coisa ao mesmo tempo), isso geralmente é visto como algo positivo.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Javascript -> JavaScript

@ggarber42
Copy link
Author

Acredito que foi tudo e desculpa a demora.

Copy link
Contributor

@joaostein joaostein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faltaram diversos itens do review anterior. Poderia, por gentileza, olhar com atenção cada um dos comentários e fazer as correções? (você pode usar o botão "Resolve Conversation" em baixo de cada comentário e ir fazendo um por um)

@@ -1298,59 +862,35 @@ locateScalpel(bigOak).then(console.log);

if}}

{{hint
{{dica:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deixar como original {{hint ao invés de traduzir para {{dica

@@ -1386,29 +926,16 @@ Promise_all([soon(1), Promise.reject("X"), soon(3)])

if}}

{{hint
{{dica:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deixar como original {{hint ao invés de traduzir para {{dica

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants