Computer Programming with the Nim Programming Language
STD/ASYNCHTTPSERVER implements a high- performance asynchronous HTTP server. Some other modules, like STD/HTTPCLIENT, support synchronous and asynchronous data transfers. Nim’s async/await framework is not part detail and offers some possible solutions for more accurate timings. File download The module STD/HTTPCLIENT of Nim’s standard library provides procedures for synchronous and asynchronous file transfer. You might need to compile the example using the -d:ssl option: # nim r -d:ssl t.nim import std/httpclient let client = newHttpClient() echo client.getContent("http://ssalewski.de/tmp/texttestpage1.txt")0 码力 | 865 页 | 7.45 MB | 1 年前3Computer Programming with the Nim Programming Language
STD/ASYNCHTTPSERVER implements a high- performance asynchronous HTTP server. Some other modules, like STD/HTTPCLIENT, support synchronous and asynchronous data transfers. Nim’s async/await framework is not part detail and offers some possible solutions for more accurate timings. File download The module STD/HTTPCLIENT of Nim’s standard library provides procedures for synchronous and asynchronous file transfer. You might need to compile the example using the -d:ssl option: # nim r -d:ssl t.nim import std/httpclient let client = newHttpClient() echo client.getContent("http://ssalewski.de/tmp/texttestpage1.txt")0 码力 | 784 页 | 2.13 MB | 1 年前3Computer Programming with the Nim Programming Language
You might need to compile the example using the -d:ssl option: # nim r -d:ssl t.nim import std/httpclient let client = newHttpClient() echo client.getContent("http://ssalewski.de/tmp/texttestpage1.txt") documentation for std/httpclient shows us how we can do the download in an asyn chronous way — at least for one single file: 451 # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(): above code to download two files asynchronously: # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(url: string): Future[string] {.async.} = return await newAsyncHttpClient().getContent(url)0 码力 | 512 页 | 3.54 MB | 1 年前3Computer Programming with the Nim Programming Language
You might need to compile the example using the -d:ssl option: # nim r -d:ssl t.nim import std/httpclient let client = newHttpClient() echo client.getContent("http://ssalewski.de/tmp/texttestpage1.txt") documentation for std/httpclient shows us how we can do the download in an asynchro nous way — at least for one single file: # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(): above code to download two files asynchronously: # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(url: string): Future[string] {.async.} = return await newAsyncHttpClient().getContent(url)0 码力 | 508 页 | 3.50 MB | 1 年前3Computer Programming with the Nim Programming Language
You might need to compile the example using the -d:ssl option: # nim r -d:ssl t.nim import std/httpclient let client = newHttpClient() echo client.getContent("http://ssalewski.de/tmp/texttestpage1.txt") documentation for std/httpclient shows us how we can do the download in an asyn chronous way — at least for one single file: 451 # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(): above code to download two files asynchronously: # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(url: string): Future[string] {.async.} = return await newAsyncHttpClient().getContent(url)0 码力 | 512 页 | 3.53 MB | 1 年前3Computer Programming with the Nim Programming Language
You might need to compile the example using the -d:ssl option: # nim r -d:ssl t.nim import std/httpclient let client = newHttpClient() echo client.getContent("http://ssalewski.de/tmp/texttestpage1.txt") documentation for std/httpclient shows us how we can do the download in an asynchro nous way — at least for one single file: # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(): above code to download two files asynchronously: # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(url: string): Future[string] {.async.} = return await newAsyncHttpClient().getContent(url)0 码力 | 508 页 | 3.54 MB | 1 年前3Computer Programming with the Nim Programming Language
You might need to compile the example using the -d:ssl option: # nim r -d:ssl t.nim import std/httpclient let client = newHttpClient() echo client.getContent("http://ssalewski.de/tmp/texttestpage1.txt") documentation for std/httpclient shows us how we can do the download in an asynchro nous way — at least for one single file: # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(): above code to download two files asynchronously: # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(url: string): Future[string] {.async.} = return await newAsyncHttpClient().getContent(url)0 码力 | 508 页 | 3.50 MB | 1 年前3Computer Programming with the Nim Programming Language
You might need to compile the example using the -d:ssl option: # nim r -d:ssl t.nim import std/httpclient let client = newHttpClient() echo client.getContent("http://ssalewski.de/tmp/texttestpage1.txt") documentation for std/httpclient shows us how we can do the download in an asynchro nous way — at least for one single file: # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(): above code to download two files asynchronously: # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(url: string): Future[string] {.async.} = return await newAsyncHttpClient().getContent(url)0 码力 | 508 页 | 3.52 MB | 1 年前3Computer Programming with the Nim Programming Language
You might need to compile the example using the -d:ssl option: # nim r -d:ssl t.nim import std/httpclient let client = newHttpClient() echo client.getContent("http://ssalewski.de/tmp/texttestpage1.txt") documentation for std/httpclient shows us how we can do the download in an asynchro nous way — at least for one single file: # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(): above code to download two files asynchronously: # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(url: string): Future[string] {.async.} = return await newAsyncHttpClient().getContent(url)0 码力 | 508 页 | 3.53 MB | 1 年前3Computer Programming with the Nim Programming Language
You might need to compile the example using the -d:ssl option: # nim r -d:ssl t.nim import std/httpclient let client = newHttpClient() echo client.getContent("http://ssalewski.de/tmp/texttestpage1.txt") documentation for std/httpclient shows us how we can do the download in an asyn chronous way — at least for one single file: 451 # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(): above code to download two files asynchronously: # nim r -d:ssl t.nim import std/[asyncdispatch, httpclient] proc asyncProc(url: string): Future[string] {.async.} = return await newAsyncHttpClient().getContent(url)0 码力 | 512 页 | 3.50 MB | 1 年前3
共 28 条
- 1
- 2
- 3